Page 2 of 2
Re: {content item=page}?
Posted: Fri Oct 08, 2010 5:57 am
by uniqu3
Maybe you should read some hot to use and how to do help files
Did you edit your htaccess file so your mod_rewrite also can work? Example htaccess.txt can be found on /doc folder of CMSMS, simply change it to .htaccess and upload to you CMSMS root folder, if it's in a subfolder you will have to change RewriteBase setting in .htaccess.
Re: {content item=page}?
Posted: Fri Oct 08, 2010 10:18 am
by NaN
I don't understand the problem.
You need to call the menu two times.
First to get the menu entries.
Use smarty {capture} to assign the output to a var. (to avoid processing the menu for each content again):
Code: Select all
{capture assign="menu"}{menu ... }{/capture}
Second to get the content output.
There you place for each content the menu we just captured:
Code: Select all
{foreach from=$nodelist item=node}
<div id="{$node->alias}" class="scrollto_container">
<a name="{$node->alias}"></a>
<div class="menu">{$menu}</div>
<div class="content">
{eval var=$cgsimple->get_page_content($node->alias)}
</div>
</div>
{/foreach}
This will give you the content of all pages wrapped in a div with id="[pagealias]" and an anchor link named with the page content alias (to be able to use your site without js).
All you need to do now is to create a menu template that just links to that anchors:
Code: Select all
{foreach from=$nodelist item=node}
...
<a href="#{$node->alias}" class="scrollto">{$node->menutext}</a>
...
{/foreach}
If the anchorlinks still cause a reloading of the page you can prepend the root_url to the menulink:
Code: Select all
<a href="{root_url}#{$node->alias}" class="scrollto">{$node->menutext}</a>
Additionally you need a js that tells jQuery what to do if links of class "scrollto" are clicked but returns false:
I don't understand what this has to do with mod_rewrite.
Re: {content item=page}?
Posted: Sat Oct 09, 2010 2:07 am
by Ruben_c
Thanks for the answers, I get the content in separates div and create the respective menu fixed in the header pointing to the divs. My probem is how deactivate or disable the links.
An explantion.
if you create the following link in a simple html file
page don`t do nothing. right? don't go anywhere.
but if a create this same link in a content page of CMSMS or in menu, IT send me to the home page, I don't wanna go to the homepage!!
I explain well? I want create dead links, but I can't... and don`t know why. Maybe this is a feature of the CMSMS?.
Re: {content item=page}? [solved]
Posted: Sat Oct 09, 2010 5:32 am
by Ruben_c
Well, with default template the problem was solved. I trying a test site with 5 page anyone with a diferent template, the last one using the scroll. Just when a turn it to a default, all works fine!!.
Re: {content item=page}? [solved]
Posted: Sat Oct 09, 2010 11:01 am
by spcherub
I don't believe the problem is solved - it is just masked because your links now point to the page this is the new page. So the page is reloading but it does not look different because it is loading the page that you are already on.
You will run into issue if you use this menu on other pages - your links will lead back to the (no new) default page.
Just saying!
Sanjay
Re: {content item=page}? [solved]
Posted: Sat Oct 09, 2010 8:34 pm
by Ruben_c
Yes, you're right, but at least work

, and don't know how to kill the links to avoid the redirection.
Re: {content item=page}? [solved]
Posted: Sat Oct 09, 2010 10:22 pm
by spcherub
If you give us access to a dev site perhaps we can help you fiz the problem instead of just masking it. Normally using onclick="return false;" disables the default behavior of the tag. You said it did not work for you, but it hard to know what else is interfering with that.
Try this piece of code in a simple html page (or anywhere in your template):
Code: Select all
<a href="http://yahoo.com" onclick="return false;">Disabled link</a>
You will see the link but it is inactive (or at least it should be). If not, there's something else going on and only being able to look into your specific setup will we be able to help out more.
Sanjay
Re: {content item=page}? [solved]
Posted: Sun Oct 10, 2010 4:38 pm
by NaN
@Ruben_c: Are there any other javascripts that has influence of the link behaviour?
Re: {content item=page}? [solved]
Posted: Sun Oct 10, 2010 4:46 pm
by spcherub
Yes with some frameworks like jQuery you can override default behavior. For instance one can do the following:
Code: Select all
$(document).ready(function() {
$('a').click(function(e) {
e.preventDefault();
});
});
This will prevent the default behavior of ALL links on the page. So not knowing what else may have this kind of effect on the original poster's problematic page makes it harder to figure out what else is going no.
NaN - as I finish typing this I realize that you may not have been asking the question of me, but of the original poster. I'll leave my comment here anyway, so he can get an idea of other potential problem sources.
S
Re: {content item=page}? [solved]
Posted: Sun Oct 10, 2010 6:19 pm
by NaN
spcherub wrote:
NaN - as I finish typing this I realize that you may not have been asking the question of me, but of the original poster.
Right

Marked it with an "@Ruben_c".
Just wanted to know if there is some javascript that returns true or anything else but false if this link is clicked. So that an onclick="return false;" maybe would have no effect.
Another question @Ruben:
Is the base tag used in your template?
How does it look like? If there is any difference between your base url and the currently loaded url in address bar the browser might load the base url apending the # (cause he thinks it is anchor on another page).