Wednesday 01 October 2003 1:02:01 pm
Vivienne, Thanks for explaining the object-element. Based on your post I understand this is the main method for including links to other on-site articles and objects. However, when I use this method on the intranet sample site, links are not shown inline in the current paragraph, but shown as block elements. Also, I can't find a way to set the source anchor text, i.e. the text you click on. (I understand this is taken from the object you link to.) What I am looking for is a way to generate a hypertext link from one article to another article. The link should be displayed as an inline element, and I should be able to control both the anchor text as well as the title-attribute of the anchor element. Since writing my initial message, I've done a dive into the ez publish 3.2 code to find a way to achieve my goal. I learnt several things: It is possible to have an object xml element displayed inline in the current paragraph. The file ./design/standard/templates/content/datatype/view/ezxmltags/object.tpl contains a hint on how to do this in the following comment from the file:
Set variable to true if the object should be rendered
as a block tag. If it should be rendered as inline use
false. {set-block scope=root variable=is_block}true{/set-block} I tried this, but it did not work. I went further into the code and discovered that if I made a small change in kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php the is_block variable from above took effect. What I did was to change this line: if ( $tpl->hasVariable( 'is_block', 'xmltagns:ContentView' ) ) into this: if ( $tpl->hasVariable( 'is_block', 'xmltagns' ) ) The change has to do with what namespace hasVariable() checks for presence of is_block. I'm unable to tell if this is a simple typo, or what the full story is here. After making the change above, I am now able to control via templates if object-elements are displayed inline in the current paragraph or as a separate block-level element. The next thing I would like to see is a way to control both the anchor text and the title attribute of the html a-element. As far as I can see the ez publish xml object element does not support a title-attribute, but I could be wrong on that. What I would like to see is that the object-element supports two attributes, title and text. The text-attribute can be used to hold what will become the anchor text of the html a-element. I would love to hear comments from people who really know the ezxmltext code and what the plans are for further development of this module.
|