Log in

29 June 2012 @ 11:10 am
Smartsite version: iXperion 1.4, maybe older too.


To notify the web page visitor that the e-mail message was offered to the SMTP server succesfully.


When Sendmail works perfectly, it offers no way of seeing that, except for the omission of an error.


Put the Sendmail macro inside a Region macro. Then set the Sendmail's error attribute to throw its error. The Region macro will capture it. Tell the Region macro's error attribute to output its errors to screen. After the Sendmail macro, still inside the Region macro, you write up the success notification.

Now, when an error happens in the Sendmail macro, the remainder of the Region's execution will stop. Instead, the Region will show the error on screen.

However, when no error happens and sending is a success, the Region's execution will continue. Thus, the success notification is shown and the user is happy.

Technical implementation

rem="this region rem text shows up in the error stack trace"
error="{string.concat(html.tag(p, 'Error while sending e-mail:', html.break(), this.error.message())}"

rem="this sendmail rem text shows up in the error stack trace"
Implement your own parameters

<p class="successHeader">Success!</p>


Happy coding!
Current Mood: accomplishedaccomplished

Smartsite version: 5.2, 5.3.


Smartsite's built-in macros for generating menus also generate too many AIM relations.


Smartsite offers no built-in macro that creates a menu the way most clients like to see it. XLinks is too sparse, Sitemap is too broad. We want something in-between. Usually we use XLinks or recursing XLinks to get what we want. Unfortunately every XLinked hyperlink is added to the AIM relations, causing a slow-down whilst saving articles.


A possible solution would be some granularity: when do we want to add the AIM relation, and when not? Well, we want the AIM relation only when the hyperlink needs to be visible. The easiest way to do that, is to avoid rendering unneeded hyperlinks and unneeded XLinks. We need to limit the XLink recursation: only recurse on a folder when it is part of the parent hierarchy. Thus, we avoid recursing on uncles and siblings.

Technical implementation

What we need to know is the parent hierarchy. Luckily, Smartsite offers the Parents macro. Then, we need to answer the question whether an item in the hierarchy needs recursing: no when it reflects an uncle or sibling of the current article, and yes when it reflects the article itself or any of its ancestors, all the way to an arbitrary top.

We can have Smartsite answer that question by executing a simple bit of VBScript:
returnValue = (InStr(strParents, strCurrent) > 0)

We catch the returnValue in a macro buffer and check that in the recursing XLink.

Technical considerations

The VBScript InStr function will find the item number 3 inside the item number 131. That would lead to a recursion of article 131, while we were hoping to avoid that. Therefore, we must make VBScript understand that we want 3, and nothing else. We achieve that by adding delimiters. Pipes come to mind, as they are not used in numbers. Therefore, when we build the parents list, we tell the Parens macro to use a pipe as its separator. And we also adorn the current item number with pipes. Thus, we ask whether |3| exists in |131|, which is false, subsequently avoiding recursion.

Full sample code

<se rem="1st parameter: the start item number; 2nd parameter: a pipe separated list of parent numbers, with the active item number as the last one" />
<se type="script" language="vbscript" save="doRecurse" rem="recurse only when the evaluated item lies within the parents path">
Dim strParents, strCurrent
strCurrent = "|{translationParam(1)}|"
strParents = "|{translationParam(2)}|"
returnValue = (InStr(strParents, strCurrent) > 0)

And of course we apply this to our XLink Recursion discussed earlier.

Happy coding!

Current Mood: cheerfulcheerful
25 February 2011 @ 11:49 am
Error: Hardware lock DLL Initialization failed.

 this means that the softlockID can't find any usb ports on your system.
This can happens when you are working on a vm machine.
Still if you aren't using any usb ports the software licenseis will still searching for usb ports.
So you need to add usb ports to the server to let the license work.

you can check the Device manager in windows to see if you got usb controllers.

Smartsite cache doesn't work when using a different character set then what smartsite is using, for example "charset =ISO=8859-1". 
There is a workaround for this is you add an extra field in the table mime types with the name Urlmunging. Field type must be BIT.
Everything what needs to be cached must be set to true. Image or videos needs to be set to False,
To get this working you need to run a site reload.

Kind Regards,

Peter Colemonts - Colours
This issue only appears for smartsite 5.x and not for ixperion.

When you ask the properties from a picture in a smartsite body, and you choose the image tab. You can choose if the check "Keep Aspect Ratio" is checked or unchecked.
When you uncheck it and choose ok or apply to save changes it doesn't work. When you ask the properties again from the image, you will see that the check  is been checked again.

Smartsite knows this issue and will resolve it in the next smartsite build for 5.3

The workaround is to go in the html edit mode and add aspect ratio as parameter. (;ar=0)

<img src="[urlprefix]Afbeeldingen/Actueel/2miljoenste/banner_url.png?hid=img;w=100;h=420;ar=0"/>
01 February 2011 @ 08:38 pm
Is only tested in smartsite 5.2

When you are using a parent macro (<se type="parents" />) you will get a problem when it shows more then 3 results.
/title1/title2  /title3

Instead of

the second result will get an space. If you check the source you will see this space is actually a breakline.
This is a know issue. There is only one way to solve this issue.

Check example below:

<se type="parents" save="buffername" />
replacedata=" /:=/"

Do not use a macro in xml style and also use replacedata to remove the space from the resultoutput.
Remember those MS VB6 components we created for the 5.x series of Smartsite? Remember how to debug them?

Last time we debugged a component and needed to step through the source code, was 3 years ago. And we forgot how to do it.

So, here's how:
1. Install MS VB6 on the web server.
2. Turn off the IIS and turn on the Smartserver.
3. Replace your macro.type attribute with the macro.object attribute.
4. Set MS VB6 to run the component, and place a break on the class *_execute() event.
5. Invoke the page.

Simple, yes?

Yes. Once you know how.
Current Mood: grumpygrumpy
26 May 2010 @ 01:01 pm
One of Smartsite iXperion's greater achievements is the cache macro, which gives us a great degree of control over what page part is cached when, why, and for how long.

Unfortunately, the documentation about that macro fails to provide examples of its keydependencies attribute.

We use this attribute to create different versions of the cache based on differing parametrized input, like the values submitted by a search form.

We set keydependencies as a comma separated list of vipers. In case the values come from a hypothetical language choice in a form, we can set it like so:

<se:cache maxage="12:00:00" keydependencies="{request.form(language,default='EN')}">
<!-- cachable code here -->

In case of more form values, we can combine them comma-separated, like so:
<se:cache maxage="12:00:00" keydependencies="{request.form(language,default='EN')},{request.form(month,default=5)}">
<!-- cachable code here -->

We can even combine these values with query parameters, for instance to allow for paging:
<se:cache maxage="12:00:00" keydependencies="{request.form(language,default='EN')},{request.form(month,default=5)},{request.query(page,default=1)}">
<!-- cachable code here -->

Mind you, Smartsite needs to cache each dependency variation separately.

Happy caching!
Current Mood: creativecreative
Chances are, that your Smartsite iXperion Manager generates error dialogs about missing manager actions and resource files, when you change and save the default channel item.

With credit to the Smartsite Helpdesk, add a headermapping key, old style, to the Smartsite Site Registry, with a name formatted as follows:

in which you need to replace <domain> with 1 of 3 possibilities:

  1. The machine name, in case of a testing / development environment

  2. The text "localhost", in case the only person to access that machine is you, via the machine itself

  3. The fully qualified domain name to the web site (like smartsite.livejournal.com), in case of a production environment.

Within that key, add a string value named 'ch' with a value of 'MGR'.

Happy channeling!
Current Mood: chipperchipper
Suppose your client has their site split up into several channels (which, by the way, is the preferred method). Suppose each channel is asigned its own sub tree. Suppose each sub tree has its own collection of helper items. Then how can we tell an article entry template in the iXperion manager to present the correct collection, based on the channel in which thee article resides?

(Or: if you're in channel A, the article should present a collection from channel A, but if you're in channel B, the article should present a collection from channel B.)

Why would this be a question at all? Because the Smartsite Manager, including the one used in iXperion, does not recognise the channel separation while entering new or editing existing articles.

The solution relies on scripting of the contenttype fieldproperties.

For instance, a contenttype field of type ItemInput may have a property StartNode. Within that property, we can use a script viper. (Remember to use Smartsite 5 vipers when coding for the Manager, even when running iXperion!) (By the way: normally entering a script text into the StartNode property proves cumbersome. Make it easier by forcing all properties to use a text editor. Check your personal manager options.)

Here's an example:

Dim channelvalue
If Len(data("parent"))=0 Then 'Editor is creating a new article
 channelvalue=ado.executescalar( _
   "select subtree from contents where nr=?", data("key"))
Else 'Editor is editing an existing article
 channelvalue=ado.executescalar( _ 
   "select subtree from contents where nr=?", data("nr"))
End If
Select Case channelvalue
Case 2 'Default home of the default channel
 returnValue = 500 'some arbitrary folder in the default channel
Case 1000 'Home of a different channel
 returnValue = 1500 'some arbitrary folder in the other channel
Case Else 'More?
 returnValue = 1 'Site Root
End Select

Couple of remarks about this script:

  1. Yes, it does start with "{script:". This is the start of the script viper. Yes, a new line after that opening is required.

  2. It uses the VBScript language by default. Remember to quote your strings.

  3. Avoid using vipers inside the script block: they used to work in Smartsite 5.x, but fail under iXperion.

  4. Subtree management is required for the sampled queries. Older versions of Smartsite might not support subtrees. Vary the queries accordingly.

  5. Setting the magic returnValue variable returns the desired data out of the script block and into the field property.

Of course you can employ similar scripts to switch entire SQL queries, to change entry template colours, or to hide fields.

Happy dividing!
Current Mood: accomplishedaccomplished