<! {more} to split contents of long pages

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

<! {more} to split contents of long pages

Post by mikemcvey »

Is it possible to split content pages into 2 like the news modules does?

Thanks
mIke
Fido
Forum Members
Forum Members
Posts: 104
Joined: Fri Mar 31, 2006 3:10 pm

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

Post by Fido »

hello,

what do you want to do ?
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

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

Post 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...
Fido
Forum Members
Forum Members
Posts: 104
Joined: Fri Mar 31, 2006 3:10 pm

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

Post 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 ?
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

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

Post 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
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

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

Post 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.
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

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

Post 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?
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

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

Post 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.  ;)
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

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

Post 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!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

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

Post 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
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

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

Post by mikemcvey »

-> "FeedbackForm module"

Will have a look at it thanks..
Post Reply

Return to “Developers Discussion”