How add wrappers to shortcodes with different parms? #5380
Replies: 3 comments 7 replies
-
maybe a dumb answer/question (from me) ( do understand what the goal seems) but is it not hierarchy? topic views is a shortcode to be actived on entry of page (url) same for replies. the simple one uses your naming striphtml (call it function) then open page > page affected I hope it makes sence what im trying to say ( at least that how i would interpret what i see). |
Beta Was this translation helpful? Give feedback.
-
News templates use parameters new way (with :)
Wrappers are for adding HTML code depending if the shortcode is empty or not. Can it be {SPT_STRIPHTML=TOPIC_VIEWS} ever empty or is the value always a number (zero is a number too)? Your goal should be solved by adding parameters to the shortcode itself not in the template. This part should be part of shortcode: |
Beta Was this translation helpful? Give feedback.
-
@rica-carv Can you write me your definition of shortcode in e107 environment then? For me, it is any HTML output for use in templates. So it is correct to use HTML directly in shortcode, it is not an issue if shortcode has good logic. Wrappers are only for shortcodes that are not mandatory (like the second password field in the signup template) or images in news... If your shortcode has always output (like forum posts), using a wrapper is useless. If your output of the shortcode depends on parameters, it should be managed by the shortcode itself. Don't do more mess with shortcodes than already is. Using shortcodes in wrapper itself is creating a headache for me. Otherwise, I got your point. Rules for shortcode should be that all HTML output can be manipulated by parameters... like class, style, wrap, use link or not etc... Or with preferences. There are many examples. What you are trying to do - there is already an example for this in core by CaMeRon, it is the parameter for shortcode... I can't remember where it is used now, but you can name it however you like. Freely try to use it as you want, you may find that wrappers will not work as you think (first using takes everything)... I was there too. @Alex-e107nl Unfortunately, inline styling (and inline javascript) is more popular nowadays. It is related to visual editors... @rica-carv By the way, don't you have in your plugin global shortcode (from e_shortcode)? Any. If you use it in the plugin template, do you happen to know if it's working for you? It is working for the theme template for me only. I can't remember if this is intentional or not. |
Beta Was this translation helpful? Give feedback.
-
I want to customize wrapping around two shortcodes with different parms, for instance:
right now i have to "hardcode" them inside the HTML, like this:
Is there any chance to use wrappers around them?
This is not working:
But other simple wrappers do work, like for instance:
Beta Was this translation helpful? Give feedback.
All reactions