-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optional blocks #6
Comments
The availability of optional blocks would be very nice, but your Problem can be solved with custom aliases too. Define a _support alias in the admin interface with type page and prefix :support: and use the field "parent service_support". |
your suggestion seems nice, but can't get it to work any way, tried all combinations i could think of
|
Sorry for not replying earlier, I got no notification from github. Your have to write the suffix th the datatemplateentry: ---- datatemplateentry ---- parent_support: whateverand in the template itself only use @@parent_support@@, dokuwiki will create the link itself. |
are you sure what are you saying? as afaik formatting from i mean did you test what are you suggesting here? i just can't get it work like you say closest thing i get, is to fill in template:
so it with such dataentry:
it can print "portal_support", but as text, not link |
can you review my wish again and say what can be done here? |
Sorry for not replying earlier. I did not feel like optional blocks belong in the plugin. I checked if other plugins could maybe provide that possibility (e.g. the macros plugin), but never tried if it really works. However, kasimon is partially right: the plugin supports the default http://www.dokuwiki.org/plugin:data#type_aliases, but only when using @@abc@@ placeholders (not @@!abc@@). I have the following suggestions and hope that one of them will work for you:
This will result in an empty table cell but no broken links if no parent is defined.
But it turns out that the current implementation of datatemplate does not support custom column types, and the data plugin does not seem to accept table syntax in a type definition. Hence this solution would require some investigation and programming. |
yeah, different template is not good way to go, as "parent page" is not only optional field i want to have, i just made sample with one field... |
What about defining the whole table row inside the datatemplateentry? ---- datatemplateentry service ---- template : playground:tpl_issue6 Service Name_page : scms parent : |Parent support|[[support:test]]| ---- |
i don't understand, this is supposed to work with current code? can you show both page and template in that case? |
It should. I have it working here: http://129.194.119.140/wiki/playground:dt_test |
added some parser can be used like:
however it has problem with newlines, no matter how i try it will either lose needed newlines, or add extra newlines, so that the table gets broken (extra newline adds new table, or missing newlines make next row being column to previous row) as it should support combinations of:
|
it would be useful to have optional blocks:
say if some field is not defined, but in template it includes some markup, it would create broken/partial links:
in case my page does not define "parent service" i get rendered partial link:
perhaps such markup:
The text was updated successfully, but these errors were encountered: