Page 1 of 2

{content item=page}? [solved]

Posted: Wed Oct 06, 2010 8:55 pm
by Ruben_c
I want to do some like this

{foreach item=page from=$content}
menu_name_of_the_page}">{$page->content_of_the_page}

{/foreach}

it's that posible?

I want that the div id be the same of the title of the respective page in the menu.

any suggest?

Re: {content item=page}?

Posted: Thu Oct 07, 2010 12:38 am
by NaN
What is $content ?

Re: {content item=page}?

Posted: Thu Oct 07, 2010 3:00 am
by spcherub
It seems like you want to do what the MenuManager is already capable of doing well. If you are familiar with the menu templates, all you need is a new template with the appropriate code. The variables are a little different from what you have listed, but an existing menu template should clue you what to do.

Another option if you don't want to use the MenuManager is to user Calguy's CGSimpleSmarty module where you can loop through a targeted set of pages and access their properties.

Let us know if you need code examples of any of the above options.

Sanjay

Re: {content item=page}?

Posted: Thu Oct 07, 2010 6:59 pm
by Ruben_c
The $content variable is just for example. ;D, I really don`t know what variable use to get the content of the page

I dont want a menu, I want that every page load into a div wich ID is exactly the same of the title of the menu.

With code like this:

{foreach item=page from=$content}
menu_name_of_the_page}">{$page->content_of_the_page}

{/foreach}

get some like this:


content of home
content of service
content of about us
content of contact

it`s possible?

Re: {content item=page}?

Posted: Thu Oct 07, 2010 7:11 pm
by uniqu3
Ruben i think you are thinking to complicated :-)

how is your page structred?

For example you could do this  as following:

In MenuManager you should first give your element some id for example it could look like this
url}" id="{$node->alias}">{$node->menutext}
And in your Temaplate you simply do this:


your stuff here
{content}
So what will you get with this?
If for example you have a page "Service" and alias (you can change this in "edit page -> options tab -> alia input field") and alias of this page is "service" you will get something like.

Home
Service



something, your content or whatever

Re: {content item=page}?

Posted: Thu Oct 07, 2010 8:23 pm
by Ruben_c
Thanks for the answers!!.

I want to load all the content of the site at once. And about the menu, I really dont care, becouse it will be like this

home

and in the body


content of home
content of service
content of about us
content of contact


just load the content at once.

Is wel explained?
???

Re: {content item=page}?

Posted: Thu Oct 07, 2010 8:29 pm
by uniqu3
Ok as i guess you want to do sort of one page layout with ajaxified effect without fall back if js is not loaded?

Well you can take a look at CGSimpleSmarty, it is capable to output content from other pages.
http://dev.cmsmadesimple.org/projects/cgsimplesmarty

Re: {content item=page}?

Posted: Thu Oct 07, 2010 9:02 pm
by Ruben_c
Yes, but  i want to use scroll to of jquery.

I try with cgsimplesmarty.

Thanks

Re: {content item=page}?

Posted: Thu Oct 07, 2010 9:39 pm
by NaN
Please consider that loading all pages including their content at once will require lots of resources.
(mostly RAM)

Re: {content item=page}?

Posted: Thu Oct 07, 2010 9:56 pm
by Ruben_c
O yes, thanks,  but is just for a simple site with few content.

Re: {content item=page}?

Posted: Thu Oct 07, 2010 11:05 pm
by Ruben_c
Well, I do that:

{foreach from=$nodelist item=node}
{assign var=page value=$node->alias}

{$cgsimple->get_page_content($page,'','foo')}{eval var=$foo}

{/foreach} 

But now I have a problem with the menu.  I have

page1
page2

I want to load nothing, but go to de home page!!  :-[  I just want the menu do nothing

Re: {content item=page}?

Posted: Fri Oct 08, 2010 12:19 am
by NaN
What about onclick="return false;" ?

Re: {content item=page}?

Posted: Fri Oct 08, 2010 2:59 am
by Ruben_c
Thanks, but don't work with onclick="return false;"  :'(
I need that index.php?page=somthing  be just index.html I change $config['url_rewriting'] = 'true'; but nothing

Re: {content item=page}?

Posted: Fri Oct 08, 2010 4:43 am
by Dr.CSS
A lot of this would be easier to help you with if we new exactly what you were trying to achieve, do you have an image of it or an example site?...

The config changes for URL rewrite are right above where you change it in a comment, what you tried is not one of the choices...

Re: {content item=page}?

Posted: Fri Oct 08, 2010 4:55 am
by Ruben_c
I want to do some like this site http://www.designzoom.in/  or this http://www.solidgiant.com/ so I need that the all content of the page load at once and the menu don't send me anywhere.

I use "scroll to" of jquery, but I cant do this work using CMSMS

I get all the content, but can't fix the menu issue.

if I use $config['url_rewriting'] = 'mod_rewrite'; and html extension, nothing appear.

and without mod_rewrite,  the menu still send me to the home page even with page  :-\