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)
Custom Preview buttons
JeremyH
One "master template" will be used for generating multiple types of pages. One type of pages will be generated from one instance of a replicant. We would like to implement multiple preview buttons on the page to preview these pages.
My initial idea is below. Is there a better way?
callout button "preview"
-> onCallout:
1) Save the DCR
2) callServer to generate the page (passing appropriate information from replicant instance)
3) open that generated page in a window
PT - if it has some parameter, generate the appropriate preview page (based on parameters)- otherwise, generate all pages.
Find more posts tagged with
Comments
jbonifaci
So why exactly do you need a custom preview button? Why not have either multiple tpls or one tpl that generates multiple files? Just curious why you want to incorporate this into a callout, you didn't give enough info as to why this is needed.
~Jeff
JeremyH
We actually do have both. When generating, the .tpl will generate multiple files. There are also two different .tpls for this data type.
The template itself is rather simple - it contains category names and descriptions. The category names correspond to directories where other content is located. The order of the items in the template is the order that they will appear on output pages.
One of the template will generate pages for each category. It will include the category name and description from this tempate, as well as additional information from other templated pages that are in the corresponding directories. Users would like to be able to preview the individual pages as they alter descriptions. When generating, however, the template will generate all the description pages. An alternative way of doing preview would be to have them use the preview button, and then generate all the pages in a temp location, and have the actual 'preview page' simply output a list of links to the page. This is more straightforeward. However, the user interface is not as good. Creating multiple instances of the same template for the user to select when previewing is another option. However, this is a pain to maintain, and also a bad user interface. (There is also another template that incorporates all the categories that the users will also want to preview. This is more straightforeward.)
jbonifaci
So your main goal is to what...? To allow the user to click once and get multiple preview windows? You could do this through a tpl as well if you wanted to...? I'm still a little bit lost as to what this button will do that you can't do through a tpl?
.
JeremyH
They key difference is that there will be a preview button next to each instance of a replicant. Thus the page may have 15 preview buttons. These preview buttons will only preview the page generated from that particular replicant instance. (This is the template that when generated will produce 1 page per replicant - thus 15 pages)
The main preview button will still be used - to generate a different page that includes all replicant instances. (This tpl only produces one page)
jbonifaci
So the button is only to preview for that replicant, not to do any generation? The generation of all templates for the DCR will happen at some other time, perhaps in the workflow?
Adam Stoller
I believe the idea was that the callout would provide a preview of just the specific replicant, whereas a full preview (or generate) would create *all* the files for *all* the replicants (though the only one that would get a window shown for it would be the one directly associated with the document as a whole).
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
JeremyH
I've created a CGI to do the preview. The tricky part was getting virtualization to work (this required generating the page to a directory, and then redirecting there.) No it's a matter of going through FormAPi to find a way to get the complete path to a file...
JeremyH
Oh... And that looks like it will be simple.
jbonifaci
Glad you got things working, I just wanted to play a little devil's advocate with you before you went down one of those roads between supported and hacky,
.
~Jeff