Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

generate a responsive ShortCode


Go to End


2 Posts   648 Views

Avatar
tomys

Community Member, 4 Posts

3 March 2015 at 2:27am

Hi,

how is ist possible to generate a different ShortCode output for small size displays.
Is it possible to check if the theme (simple) has changed to the "tablet-nav" .

What we need is, to change the width from 320(tablet-nav) to 550(desktop).

shortcode:

return sprintf('<script type="text/javascript" src="http://www.bfv.de/widget/widgetresource/widgetjs"></script><div id="%s">Laden...</div><script>BFVWidget.HTML5.zeigeVereinSpiele("%s", "%s", { height: 550, width: 320});</script>',
$arguments['bfvid'],
$arguments['code'],
$arguments['bfvid']
);;

Regards,
Thomas

Avatar
Pyromanik

Community Member, 419 Posts

3 March 2015 at 3:00am

Not particularly, because as with most things, the Content is processed server side, not by the client (browser).
You'd have to alter the output of an existing (img) tag to render some kind of dynamic (asynchronous) fetcher to be used by some script (ajax) call.
And I have no idea where to start on that.