contentpart in listing

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
happy_helmi
Posts: 14
Joined: Wed 2. Apr 2008, 16:03

contentpart in listing

Post by happy_helmi »

Hi,

I have an article that contains nothing but a contentpart (external content). I now want to show the contentpart in the article listing instead of the article summary. How can I do this? Is it possible?

Best
User avatar
Oliver Georgi
Site Admin
Posts: 9918
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: contentpart in listing

Post by Oliver Georgi »

Nothing is impossible - but this is not how it is working - so no chance by default.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: contentpart in listing

Post by Jensensen »

For another CP than "external content" I just did it this way, some days ago:

Open/edit your template for "article listing" in:
[x]
where ID is the ID of your CP "external content", e.g. 142

Example of the "normal" template for article listing::
[x]

The final example with this RT applied to the first article in the site structure level, what can be found here:
[x]


Or did I misunderstand your question?
Last edited by Jensensen on Fri 19. Sep 2008, 20:27, edited 2 times in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
happy_helmi
Posts: 14
Joined: Wed 2. Apr 2008, 16:03

Re: contentpart in listing

Post by happy_helmi »

Thx.
You understood it right.

Actually I did it like you said, but I didn't change the template, I wrote a new script and put it into frontend_render, so that I can use the SHOW_CONTENT tag in the article summary.

Here's the script I used (thanks to Oliver):

Code: Select all

<?php
$content["all"] = preg_replace('/\{SHOW_CONTENT:(.*?)\}/e', 'showSelectedContent("$1");', $content["all"]);
?>
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: contentpart in listing

Post by Jensensen »

this function "showSelectedContent" seems to be newly integrated to the php code of the cms with >v1.3.9 (dev r_xyz).
will not work with earlier versions. am i right?

BTW: what's the difference/advantage of "showSelectedContent" function + FE render script vs. "good old" SHOW_CONTENT RT in brief?
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Oliver Georgi
Site Admin
Posts: 9918
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: contentpart in listing

Post by Oliver Georgi »

Jensensen wrote:this function "showSelectedContent" seems to be newly integrated to the php code of the cms with >v1.3.9 (dev r_xyz).
will not work with earlier versions. am i right?

BTW: what's the difference/advantage of "showSelectedContent" function + FE render script vs. "good old" SHOW_CONTENT RT in brief?
The function is not new - it's in there since SHOW_CONTENT is available. And it is exactly the same peace of code for rendering {SHOW_CONTENT...} - just placed in frontend_render to handle tags accessible only when article is rendered. By default SHOW_CONTENT is rendered very early.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: contentpart in listing

Post by flip-flop »

@Jensensen: You can see another example for using the function showSelectedContent in this RT {SHOW_ARTICLE_CP} (at the bottom of the RT).
Have a look into the file include/inc_front/content.func.inc.php. there you can see the chronological order of the render process.
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Post Reply