Articles with more than one page.

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Zuke

Articles with more than one page.

Post by Zuke »

So, when making content, it goes into the menu no matter what, right?  How can I add conent that is spread across maybe 3 or 4 pages without having all the pages show up in the menu?

Here's sort of how it would go right now:

Main Nav
        V
        Section
                V
                Article Page 1
                Article Page 2
                Article Page 3
                Article Page 4

And I'd want it to only show page one, then at the bottom it would have nav links to the next pages in the article.  Any idea how to do this?
         
slloyd
Forum Members
Forum Members
Posts: 195
Joined: Mon Apr 24, 2006 9:09 pm

Re: Articles with more than one page.

Post by slloyd »

Yes, you can eliminate a file from the menu! If you go to Content > Pages then go to the page you want to remove from the menu. Click on the Options tab. Uncheck the Show in Menu checkbox.

I believe there's an easy way of creating Next and Previous links, too, but I'm not sure. Maybe one of the other forum members can help you with that.
westis

Re: Articles with more than one page.

Post by westis »

Hi Zuke,

You can do next/previous links by using {cms_selflink dir="previous"}and {cms_selflink dir="next"}. You can put this in the page content or use a separate template for those pages and put the cms_selflink tag in that template.

I wish there was a pagination tag that would make several pages of one CMSMS page, by putting a tag like {page_break} where one wants the page breaks to be. But there isn't such a tag yet.

So slloyd's method is probably the only way to do it so far.
Zuke

Re: Articles with more than one page.

Post by Zuke »

Hmm.  Problem with the net page tag is it will take the reader straight out of the article they are reading and onto the next page on the site.  Correct?

This workaround also leaves the problem that when I want to move an article or archive it, I actually have to handle each separate page as a separate article, and not a part of the whole.
cyberman

Re: Articles with more than one page.

Post by cyberman »

westis wrote: I wish there was a pagination tag that would make several pages of one CMSMS page, by putting a tag like {page_break} where one wants the page breaks to be. But there isn't such a tag yet.
Hmm, perhaps it can be done by smarty  ::)

http://www.phpinsider.com/php/code/SmartyPaginate/
http://jayseae.cxliv.org/2005/03/31/aut ... ation.html
Last edited by cyberman on Tue Jun 27, 2006 5:18 am, edited 1 time in total.
Zuke

Re: Articles with more than one page.

Post by Zuke »

I'm going to sound like an idiot, but I'm not sure I understand most of those instructions.  I'm still trying to hack my way through PHP and whatnot; I haven't even touched the smarty template system that CMSMS uses.  If it works, great!  If not, I wrap it in {literal}.

The instructions sort of left me behind pretty quickly.  Anyway you can translate them into the down and dirty?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Articles with more than one page.

Post by Dr.CSS »

have you tried a selflink to the next page at the bottom of your content, you would have to make all the pages first...
Zuke

Re: Articles with more than one page.

Post by Zuke »

Well yeah, but as I said above, if I do that, at the end of the article it wouldn't say leading into the NEXT article.
User avatar
alinome.net
Forum Members
Forum Members
Posts: 124
Joined: Thu Jan 25, 2007 2:54 pm

Re: Articles with more than one page.

Post by alinome.net »

I have a similar problem. I don't want "prev" and "next" links to work outside the current menu branch! It would be very useful {cms_selflink} to have a parameter to limit its scope to a certain parent.

At the end of this post an user  suggests his own patch to {cms_selflink} to achieve that (though only for next, not for prev).

Another solution could be to use {menu} instead: you could call {menu} at the bottom of those four pages with the right parameters (e.g. start_level) to show buttons to navigate only through them.
Marcos Cruz
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Articles with more than one page.

Post by Dr.CSS »

alby has a pagination tag that uses {page/break} iirc...

The only thing about the menu idea is how to restrict it to only one next/prev. page...
User avatar
alinome.net
Forum Members
Forum Members
Posts: 124
Joined: Thu Jan 25, 2007 2:54 pm

Re: Articles with more than one page.

Post by alinome.net »

mark wrote: The only thing about the menu idea is how to restrict it to only one next/prev. page...
Right. I thought of as many buttons as pages the document has: [page1] [page2] [page3] [page4]... That can be achieved easily with {menu} but is not what Zuke needed.

These days I found a solution. It's a bit rough, but it works fine. It's not a general solution, but can be adapted to other sites.

The personal site I'm building consists of letters. Every single letter can belong to one or more branches in the hierarchy. To solve that I invented a cross tagging system (I will explain that later in other thread). Well, every menu category is a page that lists all letters under that category, but the letters are all together and apart under an independent menu root parent.

While the user browses letters, I don't want "prev" and "next" go out of the current branch, e.g. to the categories pages, or the "contact" page or whatever.

The solution I found is to capture the output of {cms_selflink} and to print it or not depending on its content.

This is the simple code needed in the template:

Code: Select all

<div id='letternav'>

{capture assign='letter_link'}
{cms_selflink dir="prev" label='Anterior: '}
{/capture}
{letter_link link=$letter_link id='prevletter'}

{capture assign='letter_link'}
{cms_selflink dir="next" label='Siguiente: '}
{/capture}
{letter_link link=$letter_link id='nextletter'}

</div> <!-- letternav -->
And this is the simple code of the UDT {letter_link}:

Code: Select all

/*

Show a link if it links to a letter page.

*/

$link = $params['link'];
$link_id = isset($params['id']) ? ' id="'.$params['id'].'"' : '' ;

if ( ereg('.*[lc]{1}[0-9]{8}.*', $link) )
{
  echo '<div class="letternavbutton"'.$link_id.'>'.$link.'</div>';
}

You see, I profit the fact that all the pages I want to show are named in a similar way: the first letter is "l" or "c" (my site is bilingual) and the rest is the date in the format "yyyymmdd". I just print links that have such a string in the XHTML code because there is no possible coincidence with other pages of the site. I think Zuke's article pages have similar names too, so this can be a possible solution.

The filter could be more elaborate, e.g. getting the page parent root, but this one is enough for me.
Last edited by alinome.net on Mon Feb 18, 2008 4:50 pm, edited 1 time in total.
Marcos Cruz
Locked

Return to “CMSMS Core”