Strip wicket tags, but keep wicket attributes - wicket

I'd like to strip special Wicket tags (e.g. wicket:panel, wicket:child, etc.) from the output in development mode, but keep the wicket:id attribute.
In the WebApplications init one can set getMarkupSettings().setStripWicketTags(true); thus removing the special tags and attributes.
Is it possible to extend / modify Wicket at some point to keep the attribute when stripSpecialTags is set to true?

This is not possible at the moment.
Please file a ticket for improvement at https://issues.apache.org/jira/browse/WICKET!
Thank you!

Why do you want to keep the wicket:id attribute? For testing/selenium? Then you can use the DebugSettings::setComponentPathAttributeName method to output the wicket component path, which is usable in selenium.

Related

XML Sitemap with typoscript makes wrong URLs

According to http://www.typo3-probleme.de/2018/07/11/typo3-sitemap-mit-typoscript-erstellen-2285/ I let TYPO3 V8.7.24 generate the sitemap.xml file. So far it works. But in the file there are not proper URL's. On every URLs end is "?type=500001", for example an URL looks like "https://www.domain.ch/angebot/online-marketing/?type=500001". As a side note , there is also Ext:Realurl in use.
My request is, how can you remove the segment "?type=500001" ? Is the reason typoscript or the extension Realurl? How can I analyse it?
Any hint is welcome. Thanks in advance for your help.
It's the link generation inside of TYPO3. that is configured by typoscript, so you could see typoscript as the culprit.
If you want to know whether realurl (or any other extension) is the culprit: disable the extension in mind. if the error is gone there is a reason to suspect this extension.
When links are generated by TYPO3 it holds some parameter to stay in the current context. Which paramaters should be considered is a configuration (so it is grounded in typoscript).
Have a look (TSOB) at config.linkVars in general (it is copied implicit to every page object) or of your page object page.config.linkVars (in your case: xml_sitemap.config.linkVars)
There is a note in the manual:
Do not include the type parameter in the linkVars list, as this can result in unexpected behavior.
Other option would be to explicit set &type=0 to every link. But don't forget to set config.uniqueLinkVars = 1 (or xml_sitemap.config.uniqueLinkVars = 1)

TYPO3 Extbase/Fluid: Change SPLIT_PATTERN_SHORTHANDSYNTAX in StandaloneView

how to change the default SPLIT_PATTERN_SHORTHANDSYNTAX ({value}) by using the StandaloneView?
My Problem:
I have to render several LaTeX pages with different content. So I will use FLUID (Template/Partials). However there is the same Problem as in JS.... Is it possible to change the default "{value}" width ###value###???
The SPLIT_PATTERN_SHORTHANDSYNTAX static variable is defined in the TemplateParser.php but how can I change this dynamically by using a PHPView or StandaloneView?
Best regards Jürgen
This is not possible to do and a feature request to add this capability has been discussed and rejected. Please see https://github.com/TYPO3Fluid/Fluid/issues/106 for more information. Consider using CDATA wrapping to protect (parts of) your template from being processed as Fluid.

Generate dynamic key in i18n AEM

I have requirement for having a dynamic key for getting value in i18n. I am using sightly. i would be having the initial part of the key but the last part i have to attach dynamically and then allow sightly to get the value for the same. Could you please help me on it.
I guess best practice would be to have a getter at some component-bean to avoid as much programming logic within the markup as possible. If you like/need to put the logic into the html anyway try something similar to this:
<p data-sly-test.keyPostfix="${isTrue ? 'true text' : 'false text'}"
data-sly-test.i18nKey="${['some.i18n.key', keyPostfix] # join='.'}"
data-sly-text="${i18nKey # i18n}">This text will be replaced by sly-text!</p>

Line breaks in Zend Navigation Menu labels

I have a need to create a <br/> tag in the display label for a menu item generated using Zend_navigation, but don't seem to be able to find a way to do so.
My navigation item is defined in the XML config as:
<registermachine>
<label>Register your Slitter Rewinder</label>
<controller>service</controller>
<action>register</action>
<route>default</route>
</registermachine>
I want to force a tag in the output HTML between 'your' and 'slitter', such that it appears on two line as below:
Register your
Slitter Rewinder
However, I can't seem to do it. obviously using in the XML breaks parsing, and using html entities means that the lable is displayed as:
Register your <br/>Slitter Rewinder
Has anyone had experience of this that can offer advice?
Thanks in advance!
there is no such option built-in you have to use a partial
$partial = array('menu.phtml', 'default');
$this->navigation()->menu()->setPartial($partial);
echo $this->navigation()->menu()->render();
http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.navigation.menu
you may also try a hack with <label><![CDATA[Menu label<br/>Second line]]></label>
I found a (hacky) solution:
I updated my navigation.xml to use {br} tokens wherever a <br/> tag is required, and then amended the base Zend/View/Helper/Navigation/Menu.php file as follows:
within htmlify function, changed
$this->view->escape($label)
to
str_replace("{br}", "<br/>", $label)
I could (and probably will) override the Zend Library Menu View Helper with my own at some point, but this at least cover it for now.
there is a escapeLabels boolean used to convert html tags and it's true by default.
You can set your navigation like this
$this->navigation()
->menu()
->escapeLabels(false)
->...
http://framework.zend.com/apidoc/2.0/classes/Zend.View.Helper.Navigation.Menu.html#escapeLabels

Zend framework decorators question

I need to add some random html content with text before and after my input field.
I know I can use description decorator and set escape option to false - this way I can simply inject arbitrary html chunk as a decorator.
But this only accounts for 1 html chunk - I need a second one after input field. If I simply output description decorator again after input field - that will output the same description chucnk.
1) Is there a way to use description decorator multiple times with different content?
2) In label decorator - is there a way to use span tag instead of label tag?
3) Can I inject random html into HtmlTag decorator?
thanks!
update:
i solved my problem by creating simple custom decorator that allows me inject random html anywhere. Still -if someone knows quick and easy answers - plz post.
You could check out the AnyMarkup decorator:
http://www.zfsnippets.com/snippets/view/id/62/anymarkup-decorator