Created
February 17, 2014 14:49
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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