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)
template extension to allow more than just htm
talksure
How do I set the template extension to allow more than just html.
I want my publishers to have the flexibility to generate their page as a jsp or html page.
How do I modify the cfg file, or is there another way to do this?
<data-type name="organization" dcr-type="xml">
<presentation>
<template name="organization.tpl" extension="html">
<locations>
<branch vpath-regex=".*" preview-dir="/">
<directory dir-regex=".*" />
</branch>
</locations>
</template>
</presentation>
</data-type>
Thanks
H
Find more posts tagged with
Comments
gzevin
I think 2 types of files will need 2 pres. templates, right? so, one would be used for HTML, another - JSP.
Or youy are talking about 1 template to generate 2 file types.
There are heaps of other options, depending on your business process, this functionality could be even built into your workflow.....
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
talksure
I'm talking about the latter -
"Or you are talking about 1 template to generate 2 file types."
I want the user to choose what the extension should be. I don't actually want to generate both file types - I simply want the user have the ability to set what they want the extension to be.
The reason is we have have an assemble template that can assemble different component files. These component files can be DCRs, HTML or JSP component files.
If the user only sourses HTML components, then they can generate a file that is .html.
Whereas if they include a jsp component that does something, then they will need to generate the page as a jsp.
So not all pages are html or jsp - we have a mix. We are also creating some new index pages as jsp will others will still be html
Utilmately we want to give the user more flexibility without the need to manage duplicate TPLs just to set file extension.
Thanks
H
hemranga
Hi,
Did u try extension="html,asp,jsp"
try separating them by commas..
Hemanth
talksure
I sure did try that - unfortunately it does not work.
sunil_j
Hi,
Do not mention any extension in the templating.cfg as shown in the following lines
<template name="organization.tpl" extension=""> and then the publisher can specify whatever extension he or she wishes.
Regards
Sunil
TeamSite Consultant
talksure
I had tried this, but it does not work
I get "Not a valid extention.
Any other suggestions.
megamala
we contacted support people regarding this. What he said is
Unfortunately, it is not possible to allow users to either have an 'html' or 'htm' extension for the generated template file. As what you have mentioned, you have to create two data types for that, one for the html extension and the other for the htm extension.
For the extension being blank, there is already feature request 9568 on this. I'll attach you to the list of customers who is interested on this feature. As with Feature Request, product management will review and make a decision on its inclusion in furture releases. If included, it will be mentioned in the release notes along with the feature request number.
Entered By: mso 9/10/2002 10:44:38 AM
Thanks in Advance
MM Guptha
gleek
has anyone come up with a solution for this? i also want my users to be able to specify their extension either html or jsp [this is for includes on my site].. leaving extension="" blank like sunil suggested does not work.
Adam Stoller
Make it simple - gie them two templates - one called "MakeHTML" and another called "MakeJSP" - and if they can't figure out which to use hit them over the head or find another place of employment.
--fish
Strolling Prime Minister of no fixed address
gleek
um, i'm sorry, but that's not the point.. i don't want to have to maintain two versions of these files as i'm already maintaining hundreds of other templates.
if anyone has actually come up with a solution to this problem, i would appreciate their input. thanks!
Adam Stoller
So - you're choice is to try and maintain a single PT that generates different output based on the extension that is supplied for the output file - which tends to mean lots of embeded conditional code - rather than maintain two distinct PTs that generate specific output for the type of file desired?
If you control the process of generating the files via a workflow (or custom menu item) you can use iwpt_compile.ipl rather than iwgen - and you can have it output to whatever filename you want. You'll just have to remember to set the TST EA's on the generated file(s) afterwards since iwpt_compile.ipl doesn't do that for you. Using iwpt_compile.ipl, you don't even have to list the PT within your templating.cfg file.
--fish
Strolling Prime Minister of no fixed address
gleek
i believe that what you are saying would work but since we don't currently have anything like that setup, i don't think that would be an acceptable solution for our site. oh well.. it would have been much easier if you could just specify more than one file extension in templating.cfg. i'll have to come up with another way.
mika
I'm glad there's been a feature request about this (9568)...I've just come across this problem as well. The pages on our site are .asp, but recently we've come across the need to add .htm pages as well. The template for both extensions will be exactly the same -- no conditional code or anything. Based on the info in this thread, it looks like my best option is to simply create two versions of the template, which is a lot of extra overhead to manage.
ZdrozZ
IMHO 2 templates is a simple solution. You don't need to maintain two templates! The second template contains just one single line: <iw_include pt="template1.tpl" mode="ptlocal" />
Migrateduser
If you want to emit 2 different files from 1 template,
consider using <iw_ostream>.
NathanW
Maybe you should sit back and ask the question why your authors would need to create .asp and .htm using th same template? With no conditional logic? We addressed this problem when we introduced .Net into our web sites - users dont have a choice any more the templates automatically generate .aspx pages even for things like include files
Nathan Wall
Department of Transport and Regional Services (Australia)