Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
43 posts Page 3 of 5
orbital wrote: can something be done or is it impossible?

Change the order :)

Code: Select all
<cms:if this_is_main_index_page >
   <cms:minify 'css' >
      css/master_slide_for_main_page.css
   </cms:minify>
<cms:else />
   <cms:minify 'css' >
      css/style2015.css
   </cms:minify>
</cms:if>
The way the tag is written, it can't process any kind of Couch logic or Couch tags inside the tag. All it sees is plain text. You'll have to place any logic outside of the tag as in @trendoman's example.
Yes, I also assumed this
Thanks
Code: Select all
<cms:minify 'css' into='css/style.min.css' media="only screen and (min-width: 800px)" >
           css/style.css
        </cms:minify>
       
        <cms:minify 'css' into='css/mStyle.min.css' media="only screen and (max-width: 799px)" >
           css/mStyle.css
        </cms:minify>
       
        <cms:minify 'css' into='css/default.min.css' >
           css/drop.css
           css/bootstrapTheme.css
           css/custom.css
           css/owl.carousel.css
           css/owl.theme.css
           css/normalize.css
        </cms:minify>

does not work with the >> media = "only screen and (min-width: 800px)
@ari1234
Please drop the attached file into your couch/addons/minify-js-css folder, overwriting the original. The tag will then pass any additional parameters after the output file name through to the <link>, <style>, or <script> tag.

:) Thanks for your input. Once I've had more time to test this mod, I'll update the original at the top of the thread.
Guys, this plug-in requires turned on allow_url_fopen on the server!!!
I have lost a lot of time to think about it - the symptoms of this problem are an empty output file.
I have updated this addon in response to questions and discussion in this thread. The new update allows the user to add attributes to the generated link, script, and style tags. I also corrected the code so that it now processes Couch tags and logic placed inside the tag. However, the end result must still resolve to a list of valid file paths separated by any kind of whitespace and/or commas.

I really appreciate all of the engagement and feedback that have helped to refine and improve the function of the cms:minify tag, and hope that it contributes to your positive experience with CouchCMS.
Tim this is great !!! I am very happy about these improvements - BRAVO ;)
Every site needs all this, thanks again.

There is only one step to the top - Minimize HTML code, what do you think about this:
https://wordpress.org/plugins/autoptimize/

Regards
Good news, Minimizers!

The latest update to the <cms:minify> tag includes improvements to the time-stamping feature, and also allows for including inline blocks of code within the minify tag. The latter is useful for mixing Couch code into your scripts and stylesheets, as described by @Saskia earlier in this thread.

If you update from a previous version of this tag, be aware that time-stamping is now turned off by default. You must enable it in minify.php.

You'll find details in the updated documentation at the top of this thread.
That's great :D
43 posts Page 3 of 5