Hi, I won't go into the details of why we're still using the Data Center version and can't even afford the multi-excerpt macro... but I was considering writing my version, how difficult can it be right?
So I'm a software developer, so I know my way around web code, but I can find very little actual guidance and examples of macro creation for confluence.
Surely this has got to be a relatively easy thing to create: a pair of macros, one to create a section with a key on a page in which content can be added, and one to 'include' on another page using that key.
Any advice, help or pointers would be cool :)
(sorry, no option to select data center hosting version)
Ok, so I got it working. Not sure if its the most efficient, but seems ok.
The Multi-Excerpt doesn't really need to do anything - just be present with a parameter defining the key.
The Include Multi-Excerpt is more complicated:
Now my final problem is using this macro within another, which works fine, but when I do an Export to Word command it gives an 'Error rendering macro' error... any ideas on that one?
Ok so now I'm going down the path of using the $content class to try and get to an object which allows me to get a new page, based on its title, but I've also come across
$content.class.forName('????') which could help instantiate another useful class?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I've done the first halve (easily?) I hope, simply ask for a excerpt key parameter and add it as an 'id' property to a div enclosing the $body. Embed on a page, assign a key, add in content and checked the page source - all looks good.
The next challenge was to do the other end - the include. This is a 'no body' macro and the parameters are the key (again) AND a page reference using the 'confluence-content' parameter type. So far so good.
The plan was to get the referenced page content, parse it to extract the 'div' part with the key id and display that.
Problem now is how do I 'get the reference page content' to do the parsing - any ideas? The 'confluence-content' param type just appears to be a string...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.