How to remove html tags added with the include macro
Asked by Romain FEVRE:

Hi.

I'm working as a trainee for Airbus in France, and I have to do a wiki for my department. This wiki must simplify the access to the multiple files used by the department people.

Then, I've been asked to make wiki pages with link to files inside.

The problem I met, is that the link I provide are "hardcored"... If the people decide to change the file location (e.g. change the organisation of the main folder), links become dead.

Then, I wanted to use the include macro in every link, by including in the link itself a page where I only wrote the folder path (e.g. H:/MainFolder/DepartmentFolder/). Then, if the targeted folder move, I just have to modify one page.

It works perfectly, or almost. The include macro add the tags \<p\>...\</p\> around the included text... And then the link doesn't work...

So my question is : Is there a way to remove those tags to make it working?

Airbus uses Confluence 2.8, and I'm only a contributor of my namespace.

Thank you!


Answers:
author: Kevin Buchs
body: Ok, so I understand you have your 200 links or so, which all reference the path H:/MainFolder/DepartmentFolder/. You only want to edit the path once. I could offer some suggestions on working your problem another way:

1. Maybe you can use a Windows drive letter mapping, say P, that could be mapped to H:/MainFolder/DepartmentFolder. When the location of the dept. folder changes, simply change that mapping. Over a Windows Domain Network, I think this change can be propagated automatically. Thus in the wiki, your path will stay fixed, as P:/dept-file.xyz.

2. Assuming H is on a network file server, then that drive letter, H, is mapped to \\\\server. You can create a second (additional) mount point on that server that references where the dept. folder is located. So \\\\server\\mountpoint can be used in your paths.

3. Let a web server serve up the files you have in the department folder. Set up a server (many free choices) with its file space containing the directories of interest. If those directories change, just change in the web server. So, the wiki would have paths like <http://department-server/dept-file.xyz.> This option is nice because it works will all browsers.

As you can see, I am avoiding your original question. I think that is going to be a tougher problem to solve. The include macro comes with this Advanced Macros plugin: <https://plugins.atlassian.com/plugin/details/145> . From my inexperienced vantage point, it seems that you don't get source for that macro. It would be hard to change it. So, I would pursue other options.

I was thinking that with bookmarks, you can, at least, have everything you need to edit on one page.

comments: author: Romain FEVRE
body: Thanks a lot.

I didn't see the problem like that, and you're totally right.

Yet, as a trainee, I'm not sure to be allowed to do something like that, but when I'll have to explain difficulties and solution I had, I'll talk about it.

Thanks a lot Kevin.


author: Kevin Buchs
body: As an outside the box answer: I wonder if you have investigated bookmarks as an option for this. You could make your bookmarks point to the filesystem location and then use {bookmarks:labels=xyz} to customize the list of bookmarks based on labels attached to the bookmarks. Maybe this does not make the nice clean list it looks like you are hoping for.

comments: author: Romain FEVRE
body: Hi.

Thanks for the answer. I indeed investigated bookmarks, but it's really what I need/want. First, as you say, it doesn't give me the list I wanted, but I could have dealt with ; Second, the deeper problem stay the same. Because with the bookmarks, to make my work achieve my goals, I would need a bookmark per file, and then, if the file sytem migrates (and that's expected for early september), I have to modify the whole bookmarks by the hand (I'm talking about around 200+ links).

Then, it was a good idea, thanks, but not the solution...


author: Jim Birch
body: I'm not 100% clear on your probelm but it sounds like you may be able to write your own user macro contains a base location? That would allow a move to be handled with a single change to the macro.

User macros have a fairly simple scripted format and can produce wiki markup or html. You would still have a problem of replacing the existing macros, unless you can somehow ditch the old macro and replace it with one of your own with the same name...


Tags: include

link