Custom Template Issues
Permalink
i've got a new block working great. My only issue is with its custom templates. What I'm doing is for the default style is being loaded through view.css, and the only changes in the templates occur in view.css. When select a custom template though the additional styling doesn't appear. I can copy the content from the templates view.css into my main view.css and with no custom template applied, it appears fine, with the modified style. However putting the exact same code into the template file doesn't work. Any thoughts?
the block is attached, planning on releasing open source in the marketplace. Its basically a mod ofhttp://alexgorbatchev.com/SyntaxHighlighter/... to allow easy use in concrete5.
I think this might be a bug with Concrete5. I have run into similar problems in the past when using custom templates in packages -- something about the c5 loader code doesn't look in the packages directory for related assets. If you move the block out of the package and into your site's /blocks/ directory and install it from there (after un-installing the package and temporarily removing that from the /packages/ directory), you can see if it works that way -- and if so then you know it's a problem specifically with the way packages work.
See:
http://www.concrete5.org/developers/bugs/5-4-1-1/overriding-package...
and:
http://www.concrete5.org/developers/bugs/5-4-1-1/global-scrapbook-b...
Unfortunately I know of no workaround -- all I can think of is manually inserting the appropriate css file in the block controller's on_page_view() method. Not sure how you can get the currently-selected custom template in code though.
See:
http://www.concrete5.org/developers/bugs/5-4-1-1/overriding-package...
and:
http://www.concrete5.org/developers/bugs/5-4-1-1/global-scrapbook-b...
Unfortunately I know of no workaround -- all I can think of is manually inserting the appropriate css file in the block controller's on_page_view() method. Not sure how you can get the currently-selected custom template in code though.
ok thanks. I couldn't get it working in the /blocks directory either- but maybe thats cause somethings wrong with my code. I don't know how to get selected custom template either though.
That's weird -- there is no code for custom templates -- either the file exists or it doesn't.
Did you uninstall the package and remove the package folder from your site before trying it in the blocks?
Did you uninstall the package and remove the package folder from your site before trying it in the blocks?
yeah, I did. Not sure whats causing it. I am on the latest beta though, ill try on a stable version