Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Pulling many DCRs into one TPL
NickAustin74
I am wondering if there's an easy straight forward way (without using too much if any custom Perl) to get a presentation TPL to pull certain data values from the series of DCRs in the same data category (made by same DCT).
I have a category in templatedata/internet/products -- which have around 11 or so product descriptions, along with teaser, title and type (there are 3 product types) - stored in indivdually named dcrs.
Now I want to pull all the title and their teaser from each product of a particular product type. Is that possible to do -- if so can someone give me some direction or advice?
The output would be something to the effect of:
Product1 Title
Product Teaser for Product 1
Product2 Title
Product Teaser for Product 2
etc...
Products shown would only be for X product type ... wouldn't show titles or teaser for products or type Y or Z.
Find more posts tagged with
Comments
Johnny
As always there are a zillion ways to tackle this one...
heres one approach.
Firstly you need to search the file system for the set of files you want to read.
You can get your starting point by finding out where you current dcr came from.
&iwpt_get_dcr_name('dirname');
That will give you the directory where your dcr was saved, so if you need to go further up (if its saved below the data directory) you'll have to do some regex to get the right path.
Next use a file finder routine to grab all your dcr's
TeamSite:
irwalk does this nicely, check the perldocs on how to use it (perldoc TeamSite:
irwalk)
once you have your list you can iterate through it in a manner of ways.
Something like
<iw_iterate var="myDcr" list="
@dcrList">
;
<iw_load_dcr file_val="$mrDcr" var="dName" mode="dcrlocal"/>
...... your code here ....
</iw_iterate>
John
Sydney, Australia
Migrateduser
Hi,
Thanx for ur response. I have same issue. I am calling one dcr from other dcr .
for ex. In products i have other dcr called configuration.
In product presentation i want to read all the data from configuration dcr. Is there any simple way to read configuration dcr to get data.
Thanx in advance
Johnny
<iw_load_dcr file_val="$mrDcr" var="dName" mode="dcrlocal"/>
...... your code here ....
</iw_iterate>
John
Sydney, Australia
LooseCannon
Many post have been made and answered similarly to yours, so please use the search function provided by this forum to find the solution to your situation.