Dynamically generated article preview
Dynamically generated article preview
Dear phpwcms support team,
It's quite a long time that we're using phpwcms for our dynamic websites - mostly to our complete satisfaction
Now my question is the following:
On the website http://www.bergland.it I have a complete multi-category menu generated dynamically with the {NAV_TABLE_COLUMN} replacement-tag.
No worries so far.
Now, what I need is a dynamically generated preview (article image, title and subtitle) of every article in a given category, like on this page: http://www.bergland.it/cms/index.php?madonnas_8a1 (here it is created manually). Hence if an article is added to a category, the article preview page should display it as well.
What I was wondering is: Is there a (more or less comfortable) way of extracting all the articles of a given category from the database to print them on my preview site?
Or did I miss the relative content part or replacement tag?
Or is there maybe an easier way of implementing this?
Thanks in advance for any suggestions,
Tobias
It's quite a long time that we're using phpwcms for our dynamic websites - mostly to our complete satisfaction
Now my question is the following:
On the website http://www.bergland.it I have a complete multi-category menu generated dynamically with the {NAV_TABLE_COLUMN} replacement-tag.
No worries so far.
Now, what I need is a dynamically generated preview (article image, title and subtitle) of every article in a given category, like on this page: http://www.bergland.it/cms/index.php?madonnas_8a1 (here it is created manually). Hence if an article is added to a category, the article preview page should display it as well.
What I was wondering is: Is there a (more or less comfortable) way of extracting all the articles of a given category from the database to print them on my preview site?
Or did I miss the relative content part or replacement tag?
Or is there maybe an easier way of implementing this?
Thanks in advance for any suggestions,
Tobias
Re: Dynamically generated article preview
Hello,
I think there is an easy way to solve your problem. Have a look into the CP "teaser/link article".
Using this CP you can create your own CP templates.
Have a closer look to the difference of the selector "manual (arrow up/down) and "all other".
Knut
I think there is an easy way to solve your problem. Have a look into the CP "teaser/link article".
Using this CP you can create your own CP templates.
Have a closer look to the difference of the selector "manual (arrow up/down) and "all other".
Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Re: Dynamically generated article preview
hi, thanks for your quick reply
I'll take a look to that content parts, and let you know.
I'll take a look to that content parts, and let you know.
Re: Dynamically generated article preview
Ok, i took a closer look to the Teaser/Articlelink CP.
It seems to be exactly what I need, except for the fact that it does NOT include every article's content part(s).
Now that's a problem for me, because my article's images are not embedded in the article as normal images, they are attached as image content part.
And I need the images in my teaser.
Maybe it is possible to link the relative article's content part in the template?
Is there any replacement tag for an article's content part?
Thanks again,
Tobias
It seems to be exactly what I need, except for the fact that it does NOT include every article's content part(s).
Now that's a problem for me, because my article's images are not embedded in the article as normal images, they are attached as image content part.
And I need the images in my teaser.
Maybe it is possible to link the relative article's content part in the template?
Is there any replacement tag for an article's content part?
Thanks again,
Tobias
- Oliver Georgi
- Site Admin
- Posts: 9909
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
Re: Dynamically generated article preview
Try replacement tag:
{SHOW_CONTENT:MODE,id[,id[,...]]}
MODE options:
Oliver
{SHOW_CONTENT:MODE,id[,id[,...]]}
MODE options:
- CP - list of Content Parts | id = id of the content part, one or more possible, comma seperated.
- CPA - ascending list of Content Parts but based on selected article | id = id of article, comma seperated
- CPAD - same as CPA, but descending
- AS - list of Article Summaries | id = id of articles, comma separated
- CAS - list of Article Summaries | id = id of structure level, comma separated
Oliver
Re: Dynamically generated article preview
Ok, this is basically exactly what I need, but there is still a Problem:
How can I access the article ID in the teaser template?
Something like a replacement tag for the article ID would be incredibly helpful!
cheers meanwhile,
Tobias
How can I access the article ID in the teaser template?
Something like a replacement tag for the article ID would be incredibly helpful!
cheers meanwhile,
Tobias
Re: Dynamically generated article preview
I don´t know exactly your structure but if you wan´t to use the show_content tag in teaser, there is only one way to do so.
We need the ID of the article listed in each case. (You have written it before).
It isn´t implemented at this time:
Patch:
\include\inc_front\content\cnt8.article.inc.php
around line 395 insert:
And in your teaser template insert
Thats a very dirty solution, but for this moment I can´t see an other one.
Knut
We need the ID of the article listed in each case. (You have written it before).
It isn´t implemented at this time:
Patch:
\include\inc_front\content\cnt8.article.inc.php
around line 395 insert:
Code: Select all
// article id
$content['alink']['tr'][$key] = str_replace('{ARTICLEID}', $row["article_id"], $content['alink']['tr'][$key]);
Code: Select all
[PHP] echo showSelectedContent('CPA,{ARTICLEID}');[/PHP]
Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Re: Dynamically generated article preview
Without teaser:
An other solution without a hack: http://forum.phpwcms.org/viewtopic.php?p=109060#p109060
Or have a direct call of Show_Content in your Template (Vorlage)
$GLOBALS['aktion'][1] is the actual article id. -> Systemvariablen
Knut
An other solution without a hack: http://forum.phpwcms.org/viewtopic.php?p=109060#p109060
Or have a direct call of Show_Content in your Template (Vorlage)
Code: Select all
[PHP] echo showSelectedContent('CPA,'.$GLOBALS['aktion'][1]);[/PHP]
Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Re: Dynamically generated article preview
All you need is implemented in the newest version V1.4.2 r316(317) -> http://code.google.com/p/phpwcms/source/list
Knut
Thanks to O.G. for the implementation of this Tag.New global replacement tags {CURRENT_ARTICLEID} and {CURRENT_CATEGORYID} can be
used for (partly) dynamic replacement tags like
{SHOW_CONTENT:CPA,{CURRENT_ARTICLEID}}
Content part Teaser enhanced by replacement tags {ARTICLEID} and {CATEGORYID}
for teaser items.
Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )