Skip to content

Instantly share code, notes, and snippets.

@Logiks
Created February 17, 2014 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Logiks/9051936 to your computer and use it in GitHub Desktop.
Save Logiks/9051936 to your computer and use it in GitHub Desktop.
How to create content widget/component that displays content written using #Logiks CMS>Content Manager automatically in the page using url path.Using module#content #Logiks-Modules
<?php
//<sitepath>/about/terms
//The above path should show us content with name terms from about group.
$page=$_REQUEST['page'];
$page=explode("/",$page);
$category="about"; // default category for all contents in this page.
$contentID="about-us"; //default content for page may redirect to error page
if(count($page)>1) {
unset($page[0]);
$contentID=implode("_",$page);
} elseif(count($page)==1) {
$contentID=$page[0];
}
$contentID=str_replace("/","-",$contentID);
loadModule('content');
$title=printContent($page,$category);//Prints the content to the page and resturns the title of the page
//Instead u can also use $contentArray=getContent($page,$category);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment