Thursday, August 25, 2011

Creating an Simple Content Page Without Header,Footer,Left,Right Regions

Creating an Simple Content Page Without Header,Footer,Left,Right Region:
Create a page in the admin side with title "Content Information" and Give the url in the URL Path Settings as "content".Write a Callback function in your Module file,

function content_info(){
     return true;
}

Create a tpl file in the name of "page-content_info" in your theme folder,

<div id="container">
    <?php
    $content= db_fetch_object(db_query("SELECT nr.title,nr.body FROM node_revisions nr JOIN url_alias ua WHERE ua.dst = 'content' AND nr.title = 'Content Information'"));

//This query is used to map the content title from node_revisions table and url path from url_alias table

    print ($content->body);
    ?>
</div>
That's it,,Simply run url with 'content_info',,
Enjoy

No comments:

Post a Comment