Page 1 of 1

News module and Markdown?

Posted: Tue Apr 11, 2006 8:40 am
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.

Re: News module and Markdown?

Posted: Thu May 04, 2006 12:11 pm
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.

Re: News module and Markdown?

Posted: Thu May 04, 2006 12:42 pm
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}

Re: News module and Markdown?

Posted: Thu May 04, 2006 4:10 pm
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?

Re: News module and Markdown?

Posted: Thu May 04, 2006 5:10 pm
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.

Re: News module and Markdown?

Posted: Sat May 06, 2006 10:45 am
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?

Re: News module and Markdown?

Posted: Sat May 06, 2006 1:50 pm
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.

Re: News module and Markdown?

Posted: Sat May 06, 2006 2:19 pm
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 ?