News module and Markdown?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
hansom

News module and Markdown?

Post by hansom »

Is it possible to have the Markdown module render the articles written using the News module? The Markdown module works great with regular pages and I would like to use it for news articles as well.
hansom

Re: News module and Markdown?

Post by hansom »

Bump (please let me know if bumping is frowned upon here!). 
I've been poking around trying to figure out if it's possible but without result. Does anyone know something about this? I tried to send a message to the admin of the Markdown module but haven't got an answer.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: News module and Markdown?

Post by calguy1000 »

in 0.13b2 the markdown module is included both as a tag, and as a modifier

although I haven't tried it, you should be able to do something like

Code: Select all

{cms_module module=news category=blah|markdown}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
hansom

Re: News module and Markdown?

Post by hansom »

calguy1000 wrote: in 0.13b2 the markdown module is included both as a tag, and as a modifier

although I haven't tried it, you should be able to do something like

Code: Select all

{cms_module module=news category=blah|markdown}
Nice! Although I get the following error message:

Code: Select all

Fatal error: Cannot redeclare identify_modifier_markdown() (previously declared in W:\var\www\pub\cmsms\modules\Markdown\markdown.php:110) in W:\var\www\pub\cmsms\lib\smarty\plugins\modifier.markdown.php on line 120
Is it not possible to have both the Markdown module installed and active and the tag at the same time? I set the module to inactive, but that caused another error message:

Code: Select all

string(85) "Smarty error: unable to read resource: "module_file_tpl:News;

summary.tpl
Any thoughts on what I can try to make it work?
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: News module and Markdown?

Post by Ted »

I'm assuming that the tags and the module are conflicting.  php isn't too smart about having multiptle things named the same...

Try deactivating the markdown module.  If it starts working, then I would suggest you do the modifier on your {content} ({content|markdown}) tags in your template(s) as well.
hansom

Re: News module and Markdown?

Post by hansom »

Ted wrote: I'm assuming that the tags and the module are conflicting.  php isn't too smart about having multiptle things named the same...

Try deactivating the markdown module.  If it starts working, then I would suggest you do the modifier on your {content} ({content|markdown}) tags in your template(s) as well.
Sure, if I uninstall the Markdown module and e.g. use {$entry->content|Markdown} in the News Detail Template Markdown is applied to the News content. OTOH I now have to manually apply the modifier in each template, etc. I must say that I liked having Markdown as a separate module. Now,  I haven't been using CMSMS for very long but it seems like a nice way to go. For example I had replaced the original Markdown script with the Markdown Extra version and added the Smartypants script which was easy (I could even create a new module called Markdown Extra come to think of it). But like I said, I'm not the one to say what's the best solution.

How about a way to specify for each page and news article whether to apply any modifier like Markdown? And maybe have alternative modifiers like Textile?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: News module and Markdown?

Post by calguy1000 »

All I did to impliment the markdown module was to copy the markdown source into the smarty plugin directory.  For the markdown tag I created a little file in the same directory that referred to the first. 

Yes, you'll have to change your template or your pages to incorporate the markdown stuff, as  markdown can now be applied to any content rather easily.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
cyberman

Re: News module and Markdown?

Post by cyberman »

calguy1000 wrote: Yes, you'll have to change your template or your pages to incorporate the markdown stuff, as  markdown can now be applied to any content rather easily.
Perhaps there can be a switch for this in admin panel ?
Locked

Return to “Modules/Add-Ons”