Skip to main content

Posts

Showing posts from July, 2007

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() %> <% system.include "output.asp" %> <% strHTML = system.stopCapture() %> <% system.startCapture() %> belvoir belv0!r email add HTMLPaste <%= content.item("filename") %> &l

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)

Passing values from Javascript to Asp.Net

The trick to passing data from Javascript and Asp.Net is to use hidden inputs in the html. The hidden inputs should have the runat="server" attribute. For example: <input type="hidden" runat="server" id="hiddenfield" value="" /> Then in the Javascript, whatever value you are trying to pull from Asp.Net, set the hidden field using: document.getElementById("hiddenfield").value = "whatever value you want to set" And in the Asp.net form, you can just access the hiddenfield by using its id. string x = hiddenfield.value.text Thats all there is to it. You might need to check the syntax of it first as this is just all from my head.