We don’t have a getContentId(title). But when you get a content you’ll always find the id as the attribute @key in the current content node in the result XML. Check it out using ICE mode from admin (click “open in ICE” when viewing a menuitem).
The content I’m talking about will be used on every page across several sites.
So I guess I would have to make a menu-item on each site and publish the content under there.
Then in the default template how do I get the published content?
If you’re not even getting the current content out you need to set up a DataSource. It’s needed to ask the database things. “getContent” is a datasource we use when you open an article. If you open a menuitem with multiple published contents (no, you don’t need one menuitem per content) you use “getContentBySection” to extract them all. And then in your XSLT you loop through all the contents/content-nodes in the XML and manipulate the data for output.
So, you have the XML with the content? Try using the “Open in ICE” and use that little gray box you get to see the result XML that Enonic sends. By exploring this you will better know how to write your XSLT and xpaths.
The “result”-node is the big wrapping node, the main node. In there we have “context” for “Where am I and what settings do I have”-stuff. The “contents” node contain all your contents! Check it out =) And at last there is “relatedcontents” that groups any related data, such as other content, images, etc.