Custom Elements, like shortcodes ?

Permalink
Hi,

I was curious.. How can one includes custom elements or shortcodes into Concrete5?

Example.. if a user wants to make a button that is large or something all they would have to do is

[button]balh blahb alh[button] or something similiar?

 
Steevb replied on at Permalink Reply
Steevb
Add a 'button style' to the 'typography.css' file.

Example:
.button{background:#eee;color:#000;padding:20px;font-size:72px}


In 'content editor' select text, choose 'button' from the 'Styles' drop down list.

Voila, very big button.
ldbsdj replied on at Permalink Reply
Ye, that I am aware of.

But buttons was an example...

is there a way to add, custom code so all the user has to do is type in

there are so many other elements that some websites use that would be great for users.

like the bootstrap elements etc.

how can one add them for ease... for a person buying the template or using it, they should have the easy of using shortcodes

like even on this forum "[ code ]/[/ code ]"
jordif replied on at Permalink Reply
jordif
That's a good question. You mean like wordpress shortcodes?

I think this post might help you:

http://www.mesuva.com.au/blog/technical-notes/find-and-replace-tric...

jordi
ldbsdj replied on at Permalink Reply
I guess something like wordpress shortcodes.

I know we can make block elements, but could you imagine a whole bunch of block elements for each button, accordion, etc etc

!!
JohntheFish replied on at Permalink Reply
JohntheFish
if you browse the marketplace there are several addons that provide some kind of template/symbol within content that is then interpreted to pull in something else. (My own 'Magic Data' can be configured to do such). The others each have their own tricks.
jordif replied on at Permalink Reply
jordif
Hello John,

i didn't know about those. Your add-on looks really interesting. There is also an add-on (http://www.concrete5.org/marketplace/addons/advanced-content/) which is inspired by wordpress shortcodes and looks amazing!

thanks,

jordi
Steevb replied on at Permalink Reply
Steevb
I understand what you are saying, similar to Coda. But I have not found an easier way for a 'layman' to change elements or add styles other the way I mentioned.

I'm not sure training a client to type '[button]' to produce a button style or '[hr] to produce pre-defined hr style would be easy, but then I might be missing the point.
surefyre replied on at Permalink Reply
surefyre
One use I've put WP shortcodes to is to insert/modify text inline, e.g.

<ul>
  [magicshortcodething]
  <li>item1</li>
  <li>item2</li>
  <li>item3</li>
</ul>


Where the shortcode will output something geographically relevant at the beginning of the list if you have turned on geo features in the site.

Wordpress is a hateful thing but shortcodes are a useful feature I will likely need to replicate somehow if I get these guys to move onto C5.

G
JohntheFish replied on at Permalink Reply
JohntheFish
The symbols used in Magic Data tokens use a simple plugin architecture, so developers can add application specific symbols. The following links provide more info, including symbol development.

http://www.concrete5.org/marketplace/addons/magic-data/...
http://www.concrete5.org/marketplace/addons/magic-data-templates1/...
http://www.concrete5.org/marketplace/addons/magic-data-symbols1/...
http://www.c5magic.co.uk/add-ons/magic-data/developing-symbols/...