Articles with intro

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
_luki

Articles with intro

Post by _luki »

I've already created some sites with cmsms and know difrences between pages and news. But now, I really need to make all content as pages but some of them should have posibility to display short intro text. For better understanding I will show pages structure:

1. Start
2. Page2
3. Page4
3.1 Subpage 1
3.2 Subpage 2
3.3 Subpage 3
4. Page5

On Page4 I want to show short intro of all subpages, and I dont want to use News module for it, cause it will be a little bit akward. Subpages have normal content, its not news, in admin panel I want to sort them like pages not like news (i.e.by post date) etc.
Is there is some trick to do this in my way?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Articles with intro

Post by Dr.CSS »

You can pull page content into another using CGUtilities, IIRC, to pull subpage into parent page, as far as arranging them by date.published to be at top, you would have to do something with the menu template...
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Articles with intro

Post by Wishbone »

Dr.CSS wrote:..using CGUtilities, IIRC..
Do you mean CGSimpleSmarty?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Articles with intro

Post by Dr.CSS »

_luki

Re: Articles with intro

Post by _luki »

I've installed cgcontentutils but have no idea how to use it for my purpose...
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Articles with intro

Post by Dr.CSS »

I've never used it but just heard from another that CGSimpleSmarty works to pull content in...
_luki

Re: Articles with intro

Post by _luki »

Ok, CGSimpleSmarty looks more promising. I will try to figure sth out.
_luki

Re: Articles with intro

Post by _luki »

I've made it! :)
After installing CGSimpleSmarty i put in my template:

Code: Select all

{foreach from=$cgsimple->get_children('','',$children) item='child'}
    {if $child.show_in_menu}
        <h3>{$cgsimple->get_page_title($child.alias)}</h3>
         {cut_text text=$cgsimple->get_page_content($child.alias) lenght="110"}
        <a href="/{$child.alias}/">Read more</a>
    {/if}
{/foreach}
Tag {cut_text} is my tag, it's cutting text after x letters, code for it (put in User Defined Tag):

Code: Select all

$tresc =  $params['text'];
$ile = $params['lenght'];
    $licz = strlen($tresc);
    if ($licz>=$ile)
    {    
        $tnij = substr($tresc,0,$ile);
        $txt = $tnij."...";
    }
    else
    {$txt = $tresc;}
      echo $txt;
Locked

Return to “CMSMS Core”