Skip to main content

Posts

Showing posts with the label CrownPeak

Questions about Outages

Routine CMS maintentance windows are from 6pm - 7pm, every Monday and Wednesday. Generally, the system is still available during these times, but may be unavailable for a few minutes during that period. There are other times where maintenance must be performed outside these windows due to unforeseen circumstances. We aim to provide as much notice as possible for these events, typically via email and via an alert on the login page. The routine maintenance is also mentioned on the login page on the day of maintenance.

Change the Publishing Path for Uploaded Assets / Embedded Assets

To do this you need to use the assetfilename.asp file. Then: <% 'Place uploaded Poll Questions in the same folder as the 'DesignersPoll.asp file. Needed for Poll to work. poll_question_live_path = "/poll/poll_questions/" 'Loop through right column items to look for Poll type set right_col_list = content.createList("right_col_type") do while right_col_list.nextEntry() if right_col_list.item("right_col_type") = "poll" then 'Check if the current uploaded asset being processed matches and update publishing path if instr(right_col_list.item("poll_xml"), content.item("_cmsRemoteFileName")) > 0 then content.add "_cmsPublishPath", poll_question_live_path&content.item("_cmsRemoteFileName") exit do end if end if loop %...

Duplicate Items in the File -> New menu.

It looks like a bug, but the CMS is trying to figure out what kind of models would apply to the folder in question. To resolve this issue. 1. Goto the problematic folder. 2. Goto View -> Properties -> Access 3. Click on the New Tab 3. Uncheck All 'New Dependency' That's it. That should resolve the problem.

Meta Data in the CMS

When you goto View -> Properties -> MetaData, the form that shows up is treated sort of like a template. You can edit what type of MetaData can be entered by editing the template at /System/metadata.asp. To access the metadata content from within your asset do the following: set meta_fields = asset.getMeta(content.item("_cmsId")) meta_fields.item("title") meta_fields.item("keywords") replace(meta_fields.item("description"), vbCRLF, " ") meta_fields.item("category")

Parsing XML Documents in the CMS: 2 Methods

To start off with do this: Dim txt Dim fieldStart, fieldEnd Dim xml Dim fields Dim ltxt Dim key Dim value txt = trim(content.item("_cmsEmailBody")) ltxt = lcase(txt) fieldStart = inStr(ltxt, "<root>") fieldEnd = inStr(ltxt, "</root>") if fieldStart >= fieldEnd then content.add "_cmsError", "Invalid email format. No XML data detected." exit Sub end if ' skip the end /root fieldEnd = fieldEnd + 6 set xml = system.createXML() if not xml.loadXML(mid(txt, fieldStart, fieldEnd)) then content.add "_cmsError", "Invalid XML format." exit Sub end if Now there are two ways to parse it. Method 1: set fields = xml.selectSingleNodeAsContent("root") Method 2: set fields = xml.selectSingleNodeAsDic("root") Check to make sure we have the root node: if not isObject(fields) then content.add "_cmsError", "Invalid xml format. Missing root /root node." exit Sub end if If Method 1 ...

Nesting a Panel within a Tabbed Panel (input.asp)

If you are going to put a panel within the first tab of the Tabbed panel there are no special requirements you need to take. However, if you put the panel within the second tab, it needs to be hidden from view initially. To do this: <% input.startTabbedPanel "Tab 1, Tab 2, Tab 3" %> <% input nextTabbedPanel %> <% set list = content.createList("some_value") %> <% list.setParam "panel_stylesheet", "visibility: hidden; display: none;" %> <% do while list.nextPanel() %> <table> <tr><td>somestuff</td></tr> </table> <% loop %> <% input.nextTabbedPanel %> <% input.endTabbedPanel %> That's it. NOTE: that for the panel_stylesheet line the css needs to have ; at the end or this won't work.

Referencing Embedded Uploads In Another Asset

This breaks the methodology of embedded uploads in that embedded uploads are only supposed to be used by the asset it is embedded in. If you want many assets to be able to use an upload, you should store that upload in say the /Asset/ Directory. However, there is a way around this, but this is based on one assumption. That embedded uploads get stored in the same directory on the live site as the asset itself. Given this, you can do the following. fileName = list.item("the_upload") // This will return the path and filename to the CMS where the upload is stored. // ie. '/Myhorse/01/02/abc.gif' liveSitePath = asset.getLink(list.item("_cmsId")) // This will return the path and filname to the live site where the asset is stored // With the assumption that uploads get saved in the same directory, just do a // little string manipulation and you got it.

Abstracting Out Content Into a Layout

Heres a pattern that abstracts out common code to a single file and publishes out to the live site as an include file. Think snippet of html that gets included in the big file. 1. Create a layout file in any Template, layout.asp (clone out output would work great) 2. Create a filename.asp that checks for the layout and changes publishing path accordingly. This is so this particular layout has different name from output.asp if content.("_cmsLayout") = "layout.asp" then content.add "_cmsPublishPath", replace(content.item("_cmsPublishPath"), "old_val", "new_val" end if 3. In the template we wish to include this code do this if content.isPublishing then asset.setParam "_cmsLayout", "layout.asp" <!--#include virtual="<% asset.getLink("path to asset that uses template with layout.asp file") %>" --> 'when the asset that asset.getLink() is referring to is published, one is publi...

Making references to Assets work even if the Asset has not been published yet

In the CMS, from within the current asset if you have a link to another asset and the other asset has not been published yet. The current asset will have the link disabled when published. In some cases even content will not be displayed as well. To prevent this from happening you can use this trick: asset.setPram "filter_status", "*" href = asset.getLink("path or id") Now the href will be enabled regardless of whether the asset being reffered to has been published or not.

ExactTarget Setup

There's alot of stuff to do!! 1. Assets that will be published to ExactTarget will use the http_insert.asp and http_update.asp templates. 2. Configure HTTP Export, Package and Workflow to Publish out to the ExactTarget Server Url To Configure the HTTP Export: 1. Goto System -> Configure -> Export -> HTTP 2. Enter an abitrary name. 3. Enter URL http://www.exacttarget.com/api/integrate.asp 4. Method = Post 5. Encoding = XML fields http_insert.asp & http_update.asp uses the same code. Essentially a system.include(http_insert.asp) in the http_update.asp should do the trick: Here is the code for http_insert.asp: <% system.setdependency(false) %><% system.startCapture() %> belvoir belv0!r email add HTMLPaste &![CDATA[ ]]> qf=xml&xml= For a good example of this, MyHorse or MEHC uses this in their Newsletters.

Pagination using Dropdown List or Links for Sorting Generating Multiple Pages From a Single Asset. ie. Dynamic Sorting / Filtering

This is something that is very complicated at the moment. Essentially, what we want to do is create a dynamic sort or filter by xyz. This is handled by the CMS as a generation of multiple static pages for each sort or filter selection. The work will be done in the output.asp file and filename.asp template file. Within the output.asp, the trick is to generate links to each of the individual static pages using: asset.setParam "args", "querystringfield=abc&otherfield=abc" 'create a link back to the same page with the querystring fields attatched to it asset.getLink(content.item("_cmsId") You can then access the querystring fields by using: content.item("querystringfield") content.item("otherfield") the querystring fields get added to the content. On load? (Question that is currently unanswered) Within the filename.asp file, to generate multiple static pages: 'first check if the querystring fields are set if content.item("q...

Checking / Creating New Folders from an SMTP Import

To check if a folder exists in the CMS already you have to create a folder list. There is no direct commands to do this. dim folderExists folderExists = false set folderlist = asset.getFolderList("/path/") 'loop through folder list do while folderlist.nextEntry() if folderlist.item("_cmsLabel") = "foldername" folderExists = true exit do end if loop To create a folder in the CMS, first make a Model that only contains a folder. Then do the following: if folderExists = false then 'create folder set dict = system.createDictionary() fId = asset.create(folderName, "/Site/Global/Picture of the Week/", "/System/Models/Directory Builder", dict) end if The parameters for the asset.create("label", "Path", "Model to use", content or dictionary)