Page 1 of 1

<! {more} to split contents of long pages

Posted: Tue May 02, 2006 5:05 am
by mikemcvey
Is it possible to split content pages into 2 like the news modules does?

Thanks
mIke

Re: <! {more} to split contents of long pages

Posted: Tue May 02, 2006 6:01 am
by Fido
hello,

what do you want to do ?

Re: <! {more} to split contents of long pages

Posted: Tue May 02, 2006 7:08 am
by mikemcvey
I want to be able to add content to the page but say hallf way through insert a tag like {more}

bblah,lah,blah,blah,blah,blah,blah,blah, {more} extra, extra, extra, extra, extra, extra, extra, extra, extra, extra,!!

When you browse to the page you will get all the blah text before the {more} and the a link that you can click on to see the rest of the page which displays all content...

Re: <! {more} to split contents of long pages

Posted: Tue May 02, 2006 7:13 am
by Fido
like adding a news ?

you can do that with a cmsms selflink.

you make 2 pages and in the first one you make a link to the second one ?

Re: <! {more} to split contents of long pages

Posted: Tue May 02, 2006 9:14 pm
by mikemcvey
Yeh I realised that.. but really want to avoid my user having to creat 2 pages and links...

Really want one content page with 2 sections... a "summary" then {more} then "rest of content"

Thanks for your help :)

Mike

Re: <! {more} to split contents of long pages

Posted: Tue May 02, 2006 9:46 pm
by Ted
This has been brought up before.  While it should be possible to do, it would require a little bit of string parsing trickery to make it work right.

You don't happen to be any kind of developer, do you?  i could probably explain it in 5 min.  I just need someone to take the time to do it, or I'll have to look at it later on.

Re: <! {more} to split contents of long pages

Posted: Tue May 02, 2006 11:28 pm
by mikemcvey
Hi, 

I'm a flash developer primarily and migrating to a bit of PHP
Lucky for me the syntax is almost exactly the same as actionscript...

Are you suggesting I search the returned content for the "{more}" string and truncate?

I figure I could do that and then add the rest of the content in a hidden tag that I could toggle the vis of.. however this is not really ideal and really want to simulate the effect of 2 pages...

Any other ideas.. or is this along the lines of what you where thinking?

Re: <! {more} to split contents of long pages

Posted: Wed May 03, 2006 12:13 am
by Ted
Well, it shouldn't be too hard to split a string (the content) on a string ({more}...  though a non-smarty tag might be better).  Then you can easily get the piece you want to display from the result of the split.  The only real magic would be adding an extra parameter to the url and parsing it out to figure out which piece to show, and making a little control to display to show the next/prev links.

This would all be done in the Show() method of lib/contenttypes/Content.inc.php

Ok, so I just figured it all out.  Maybe I should just do it already.  ;)

Re: <! {more} to split contents of long pages

Posted: Wed May 03, 2006 1:11 am
by mikemcvey
mmm.. sounds all good..

;D

I really need to look into this SMARTY thing as don't really understand the structure enough to comment!
I know how to make custom tags.. I am working on one at the moment to embed a catalogue database from an old site which I am porting over to CMS....  lots to learn!

Re: <! {more} to split contents of long pages

Posted: Wed May 03, 2006 1:22 pm
by Dr.CSS
that sounds a lot like the page break in the FeedbackForm module,
i couldn't get it to work outside of the FBF module, of course as i'm no real coder.

    mark

Re: <! {more} to split contents of long pages

Posted: Wed May 03, 2006 9:53 pm
by mikemcvey
-> "FeedbackForm module"

Will have a look at it thanks..