Snippet-Beispiele
Aus DynPG-Wiki
Version vom 12. Februar 2010, 17:32 Uhr von Urs Gamper (Diskussion | Beiträge)
Inhaltsverzeichnis
- 1 Head-Snippet
- 2 CSS-Snippet
- 3 Snippet zum PHP Incluce
- 4 Snippet für einzelnen Artikel
- 5 Snippet zum Einbau der dynamischen Navigation
- 6 Snippet für aktuellen Bereich
- 7 Snippet für Folgeseite bei Verwendung der dynamischen Navigation (Standard-Globals)
- 8 Snippet für Einbau einer Gruppenliste mit zusätzlichem Wechsel des Templates
Head-Snippet
<?php require('./dynpg/getcontent.php'); $GLOBALS["DynPG"]->SetParam_PathToRoot('./dynpg/'); ?>
CSS-Snippet
<?php $GLOBALS["DynPG"]->Write_CSS_JS_Header(); ?>
Snippet zum PHP Incluce
<?php include("inc/navi.php"); ?>
Snippet für einzelnen Artikel
<?php $GLOBALS["DynPG"]->SetParam_A_Anytime(true); $GLOBALS["DynPG"]->SetParam_A_CategoryNavigation(false); $GLOBALS["DynPG"]->SetParam_A_ArticleHeader(false); $GLOBALS["DynPG"]->SetParam_A_PrintNavigation(false); $GLOBALS["DynPG"]->SetParam_A_Article(3); $GLOBALS["DynPG"]->SetParam_A_IgnoreSeperator(true); $GLOBALS["DynPG"]->Write_Article(); ?>
Empfiehlt sich als include zu realisieren
<?php $GLOBALS["DynPG"]->SetParam_PlugIn_Template('DPGdynmenu', 'intelligent'); $GLOBALS["DynPG"]->SetParam_PlugIn_Param('DPGdynmenu', 'real_expand', TRUE); $GLOBALS["DynPG"]->SetParam_PlugIn_Param('DPGdynmenu', 'order', Array('INDEX')); $GLOBALS["DynPG"]->SetParam_PlugIn_Param('DPGdynmenu', 'sort', Array('ASC')); // In den naechsten drei Globals die Folgeseite nach ab der Startseite angeben $GLOBALS["DynPG"]->SetParam_PlugIn_Param('DPGdynmenu', 'href_page_groups', '../seite2.php'); $GLOBALS["DynPG"]->SetParam_PlugIn_Param('DPGdynmenu', 'href_page_articles', '../seite2.php'); $GLOBALS["DynPG"]->SetParam_PlugIn_Param('DPGdynmenu', 'href_page_detail', '../seite2.php'); $GLOBALS["DynPG"]->SetParam_PlugIn_Param( 'DPGdynmenu', 'href_subpages', Array( 0 => Array( 'page' => '../einzelne_seite.php{query}', 'successors' => true ), // Gruppen-ID der Startseite angeben 0 => Array( 'page' => '../index.php{query}', 'successors' => true ) ) ); $GLOBALS["DynPG"]->SetupTemplate('uneditable'); $GLOBALS["DynPG"]->SetParam_A_Anytime(TRUE); $GLOBALS["DynPG"]->SetParam_A_CategoryNavigation(FALSE); $GLOBALS["DynPG"]->SetParam_A_PrintNavigation(FALSE); $GLOBALS["DynPG"]->SetParam_A_ArticleHeader(FALSE); $GLOBALS["DynPG"]->SetParam_A_Article(1); $GLOBALS["DynPG"]->Write_Article(); $GLOBALS["DynPG"]->SetupTemplate('default'); ?>
Snippet für aktuellen Bereich
Empfiehlt sich als include zu realisieren
<?php $GLOBALS["DynPG"]->setupTemplate('home'); $GLOBALS["DynPG"]->SetParam_AA_MaxView(3); $GLOBALS["DynPG"]->SetParam_AA_Order( Array( 'DATE_FROM','TIME_FROM' ) ); $GLOBALS["DynPG"]->SetParam_AA_Sort( Array( 'DESC','DESC' ) ); $GLOBALS["DynPG"]->SetParam_AA_Anytime(true, true); $GLOBALS["DynPG"]->SetParam_AA_IgnoreSeperator(true); $GLOBALS["DynPG"]->SetParam_AA_fullLoadText(false); $GLOBALS["DynPG"]->SetParam_AA_seperateHome(true); $GLOBALS["DynPG"]->SetParam_PathToNextPage('aktuell.php'); $GLOBALS["DynPG"]->Write_AllArticles(); $GLOBALS["DynPG"]->setupTemplate('default'); ?>
<?php $GLOBALS["DynPG"]->SetParam_A_CategoryNavigation(FALSE); $GLOBALS["DynPG"]->SetParam_A_PrintNavigation(TRUE); $GLOBALS["DynPG"]->SetParam_A_ArticleHeader(TRUE); $GLOBALS["DynPG"]->SetParam_AG_Anytime(TRUE); $GLOBALS["DynPG"]->SetParam_AG_ForceNav(FALSE); $GLOBALS["DynPG"]->SetParam_AG_Order( Array( 'INDEX' ) ); $GLOBALS["DynPG"]->SetParam_AG_Sort( Array( 'ASC' ) ); $GLOBALS["DynPG"]->Write_AllGroups(); $GLOBALS["DynPG"]->SetParam_A_CategoryNavigation(FALSE); $GLOBALS["DynPG"]->SetParam_A_PrintNavigation(TRUE); $GLOBALS["DynPG"]->SetParam_A_ArticleHeader(TRUE); $GLOBALS["DynPG"]->SetParam_AA_Anytime(FALSE); $GLOBALS["DynPG"]->SetParam_AA_Order( Array( 'DATE_FROM' ) ); $GLOBALS["DynPG"]->SetParam_AA_Sort( Array( 'DESC' ) ); $GLOBALS["DynPG"]->SetParam_AA_Maxview(15); $GLOBALS["DynPG"]->SetParam_AA_ForceNav(FALSE); $GLOBALS["DynPG"]->SetParam_AA_CategoryNavigation(FALSE); $GLOBALS["DynPG"]->Write_AllArticles(); $GLOBALS["DynPG"]->SetParam_A_Anytime(FALSE); $GLOBALS["DynPG"]->SetParam_A_CategoryNavigation(FALSE); $GLOBALS["DynPG"]->SetParam_A_PrintNavigation(TRUE); $GLOBALS["DynPG"]->SetParam_A_ArticleHeader(TRUE); $GLOBALS["DynPG"]->Write_Article(); ?>
Snippet für Einbau einer Gruppenliste mit zusätzlichem Wechsel des Templates
<?php $GLOBALS["DynPG"]->SetupTemplate('3_spalt'); $GLOBALS["DynPG"]->SetParam_AA_Anytime(TRUE); $GLOBALS["DynPG"]->SetParam_AA_Group("Gruppenname"); $GLOBALS["DynPG"]->Write_AllArticles(); $GLOBALS["DynPG"]->SetParam_A_Anytime(FALSE); $GLOBALS["DynPG"]->SetParam_A_CategoryNavigation(TRUE); $GLOBALS["DynPG"]->SetParam_A_PrintNavigation(TRUE); $GLOBALS["DynPG"]->SetParam_A_ArticleHeader(TRUE); $GLOBALS["DynPG"]->SetParam_A_ArticleCss(0); $GLOBALS["DynPG"]->SetParam_A_Article(0); $GLOBALS["DynPG"]->Write_Article(); $GLOBALS["DynPG"]->SetupTemplate('default'); ?>