Skip to content

Instantly share code, notes, and snippets.

@ojii
Created February 25, 2011 10:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ojii/843607 to your computer and use it in GitHub Desktop.
Save ojii/843607 to your computer and use it in GitHub Desktop.
The bit inside the 'cmsplugin' tag is actually a link plugin!
class LinkPlugin(CMSPluginBase):
def get_embed_content(self, instance, parent_instance):
ctx = Context()
return render_to_string(self.render_template, self.render(ctx, instance, None))
<p>
Some normal text. <cmsplugin pluginid="123"><a href="http://www.djanog-cms.org">django CMS website</a></cmsplugin>.
</p>
<p>
Some normal text. <cmsplugin pluginid="123" />.
</p>
<p>
Some normal text. <a href="http://www.djanog-cms.org">django CMS website</a>.
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment