It was around one or two weeks before you released the ReplacementTags-Module.
As I had the Idea to write a module very similar to yours, but I had intermediate examination, so I had no time to code...
I decided to use xml instead of curly braces.
To introduce a new namespace for example "tag" or better "drupal".
I think the best thing is to show you what I mean, how the structure should look like in my opinion:
<p>this is an ordinary paragraph inside, for example your node</p>
<drupal:image url="node/5" link="node/85" />
<p>the one above is an image included... alt-text and description printed under the image will be taken from the image-node values<br />
the attrubute link means that the image links to node/85.</p>
<drupal:image url="node/6" link="node/3" alt="another alt text">
Hello <drupal:user info="name" /><br />
this time the nodes' description will be replaced with this text
</drupal:image>
<p>let us include a view from the view.module</p>
<drupal:view name="frontpage" />
It would be relatively easy to process this code because we could use php's xml-functions
every tag-function would be able to decide what for attributes are available and if it would like to do something with the content inside the tag (<drupal:foo>text</drupal:foo>)
in my opinion an advantage of this is that many people are used to code html and so it is no big change for them to write such drupal-tags
and that you could easily hand over more then one attribute (and you can see easily what the specific attribute means)
what do you think about this?
do you think it would be an improvement?
why did you dicide to use {foo}?
Comments
Comment #1
profix898 commentedI'm not quite sure, what you means by that. What is a tag-function in your sense?
It can only decide what attributes to use, right? So you want to write a whole
function for every tag?
I think this is more a developer view! There are many people out there (for example
the standard drupal user, not webmaster/admin of a site), who dont know html and its
structure very well (or some people not at all). Think about the people using WYSIWYG
tools like TinyMCE to post content. I think those people can use {TAG} or $TAG$ much
easier than html-style tags. The other advantage is that you (the author) can find the
tags at the first sight when looking through the text. html like tags are much harder
to find among
<p>and Co.Yes. Maybe. As I described above I think this is something for more advanced users.
But I think it has potential to provide tags of much higher complexity than it is possible
with (simple) regexp-based tags.
Have you thought about a possible implementation? Did you try php's xml parser?
I think the structure of the current RepTag module can very simply been extended
to process html-style tags additionally.
(Maybe we can discuss this any further by email.
You can write to "drupal AT profix898 DOT de" even in german language ;))