0

I have a snippet (can be template if necessary) which contains a diagram as code. Is there anyway to make this selectable from the edit entry screen, and preferably associated with a wysiwyg (Expresso) field?

In an ideal world there would be a dropdown populated with the diagram names (can be manually populated) and when you select one it would drop in the snippet code.

Does anyone know if this is possible? Or even an alternative method to achieved this?

1

I'm not so sure on the Expresso Editor, but if you are using WYGWAM as your WYSIWYG editor... If this is the case this might be of some interest to you : https://github.com/pixelandtonic/wygwam_template_links never used it so not quite sure if it's exactly what you want...

Also see this article which may give you clues on how tyou could hijack the Template button in WYGWAM to serve embeds/snippets...

If all you wanted to do was perhaps enable the {embed} and snippet tags in your WYGWAM you can do this by wrapping the output in {exp:allow_eecode embed="y"} tags with the Allow EE Code plugin (seems Wyvern allows this too https://devot-ee.com/add-ons/support/wyvern/viewthread/2357)

Finally, if you wanted a bit more control, how about using Template & Snippet Select with a special marker in WYGWAM/Wyvern (yuo may need to mod/roll your own extension)

| improve this answer | |
  • Perfect! The Allow EE Code works perfectly for this. Thanks a bunch :) – Kieran McClung Jun 9 '15 at 14:29
  • No drama! Glad we can help :) – Blatant Jun 9 '15 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.