-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Ahmed Abbas edited this page Jul 13, 2025
·
7 revisions
- First, you need to configure your App API Key at the
<head>tag:
<script>
window.oggeh = window.oggeh || {
api_key: "YOUR_OGGEH_APP_API_KEY", // Required
// api_secret: "YOUR_OGGEH_APP_API_SECRET", // Use only in mobile/desktop/nodejs apps
// sandbox_key: "YOUR_OGGEH_APP_SANDBOX_KEY", // Use only in a development environment
// domain: "YOUR_OGGEH_HOSTNAME", // Use only in mobile/desktop/nodejs apps
};
</script>- Next, you need to install our web component after the above script, also at the
<head>tag:
<script src="https://unpkg.com/@oggeh/web-component/dist/oggeh.min.js"></script>- Finally, use the custom element for loading your dynamic content anywhere at the
<body>tag (see Templates).
-
config: Accepts one of the following values:
| Value | Required Propetries | Description | Example |
|---|---|---|---|
anti-flicker |
Hides page until all content is loaded | <oggeh-content config="anti-flicket"></oggeh-content> |
|
router |
Enforcing history state (SPA mode) | <oggeh-content config="router"></oggeh-content> |
|
scripts |
type="text/oggeh-defer" |
Defer template javascript after loading all content | <oggeh-content config="scripts"></oggeh-content> |
-
get(required): Accepts one of the following values:
| Value | Required Propetries | Optional Propetries | Example |
|---|---|---|---|
app |
render (options: meta, nav, slider, locations, contact, social ) |
<oggeh-content get="app" render="nav"></oggeh-content> |
|
model |
start-key |
<oggeh-content get="mode" start-key=""></oggeh-content> |
|
pages |
start-key |
<oggeh-content get="pages" start-key="" limit=""></oggeh-content> |
|
page |
key, scope (options: subject, header, ..., childs) |
<oggeh-content get="page" key=""></oggeh-content> |
|
page-related |
key, model (options: *, product, event, or a custom model key) |
<oggeh-content get="page-related" key="" model=""></oggeh-content> |
|
search-results |
keyword |
<oggeh-content get="search-results" keyword=""></oggeh-content> |
|
news |
start-date, limit
|
<oggeh-content get="news" start-date="" limit="4"></oggeh-content> |
|
news-article |
timestamp, scope (options: subject, header, ..., childs) |
<oggeh-content get="news-article" timestamp=""></oggeh-content> |
|
news-related |
timestamp, limit
|
<oggeh-content get="news-related" timestamp=""></oggeh-content> |
-
custom: Accepts a custom method defined at the globaloggehobject (see Custom Methods).
| Event | Description | Example |
|---|---|---|
oggeh.ready |
Triggers when a single tag is done with loading content | document.addEventListener('oggeh.ready', console.log) |
oggeh.navigate |
Triggers when history state changes (SPA mode) | document.addEventListener('oggeh.navigate', console.log) |
oggeh.error |
Triggers when a single tag fails to load content | document.addEventListener('oggeh.error', console.log) |
See API Reference for additional details on available values for select attribute on each API Method.
Copyrights © 2012-2025 All Rights Reserved by OGGEH, Inc.