Another replacement tag to show the contents of a particular content part. Can be very useful. It hasn't been tested for all content parts, but should work for most of them.
Put the following in a php file (for example show_content.php) in frontend_render.
Got a question....and this one might be stupid.....it is somewhat unrelated to this great rep tag....
is there anyway to access the article_id within a given article. I am working on a modification to a shopping cart script where I simply want to allow the administrator to type in {PRICE:24.00} within the article itself......and have the backend take this data and insert into an additonal table phpwcms_pricetable. Up to now I have gotten this to work:
{PRICE:7:24.00}
where 7 equals the article_id.....seems silly to have to manually enter the article_id..
and wanted to ask if the article_id can be implicitly called, thus eliminating the need to manually enter it....I have to think this is simple and it is something I am overlooking.
In principal you could create a separate editable section of 'content parts' in a site category (hidden) that would be displayed using custom blocks (right, left,etc) embedded in page templates Would allow the client to have one place to edit content that shows up in various parts of site AND in various places on page (right sidebar, left sidebar, etc).
This is indeed a cool mod. A couple quick questions:
1. Can this be made into a more formal RT using the provided format so you don't have to edit core files?
2. Isn't there new functionality like this in the latest dev release? I seem to remember reading about something similar in 2.5, but I may be wrong.
3. Is there a reason not to just put the provided code into "content.article.inc.php"? I mean, it seems like copying it into frontend_render kills your ability to have RTs in content get processed (meaning any content you try to include that HAS RTs will have the code instead of content). If therte isn't a downside maybe make content.article the default?
Good questions...I would guess that the code as is could be placed in content.func.inc.php and then be a standard Wcms rep_tag. Obviously the fact that it already works in frontend_render would suggest that this is not all that important, at least from OliG's point of view. I would say there are situations where placing code in content.func.inc.php is better. I had a situation where I wanted to use the {PAGETITLE} tag combined with Jerome's GT mod. The code was:
So like you alluded to, the operation of nested rep tags is affected by where they are placed and the order in which they are executed. In the above code, having the {PAGETITLE} tag in frontend_render did not work. GT would spit out {PAGETITLE}. Only by putting the code in content.func.inc.php (and before tcall to GT mod) did it first get parsed and properly rendered by GT mod.
With regards to second ?, the newest dev release sports 'contentpart alias', something similar in scope, but not recommended for page templates. A couple of threads can be read here:
I'm glad the repl tag was appreciated by others. Check out http://www.phpwcms.de/forum/viewtopic.php?t=8521 for my news flash content part that will take article flexibility even further, at least for me...
I went ahead and checked another domain that was running WCMS and it seems that this was just a fluke accident. If otherwise please let me know. Anyway, so I put the show_content.php file. Do I need to put the underscore on the file:
Hi all,
I haven't been here for a while, but still playing with phpwcms and getting more and more fond of it (working at my very first site with phpwcms .
My question: How can this script here be changed to put out random articles (or content parts) of a choosen structure?
I tried but noway since I'm no php'ist