MODX Gallery: how to get the number of images in a folder? - gallery

I use MODx Revolution ver.2.20 with Gallery module ver.1.4.0.
So, I need to get the number of images in a folder. I googled it, but I didn't find any working solution.
How can I get it? Thanks.
Ok, this is the solution.
Snippet call
[[!GalleryAlbums? &parent=`5` &showAll=`1` &sort=`rank` &dir=`ASC` &limit=`50` &rowTpl=`b-top-img`]]
b-top-img snippet
<!-- p-cover -->
<div class="p-cover [[+id]]">
[[!Gallery? &album=`[[+id]]` &thumbWidth=`300px` &thumbHeight=`300px` &thumbTpl=`b-middle-img`]]
</div>
<!-- /p-cover -->
b-middle-img chunk
<div class="p"><img src="[[+thumbnail]]" alt="[[+name]]" /></div>

If you are familiar with PHP you can create your own snippet from this example — http://rtfm.modx.com/display/ADDON/Gallery.GalleryItem.GalleryItemPagination

Related

Removing a fly out from a site I didn't build (is it embedded in code?)

I work for a company and have taken over responsibility for maintaining the website. The company hired an outside agency to create its website. They used Wordpress and templates. I'm used to coding with things like Divi...I'm not 100% sure how to manipulate their work.
http://comfortcarehomehealth.com. We have a fly out on the right hand side that says "Contact". It used to house a form that wasn't directing correctly so I deleted the form. However, I have no idea how to delete this little "contact" piece. I've searched within the Wordpress theme customizer and attempted to find it in the editor but I don't really know what I'm looking for. I'm not a coder so...
How do I get rid of the "contact" fly out completely?
I can find it in the view source:
<div class="cover" data-img="https://comfortcarehomehealth.com/wp-content/uploads/2015/09/CC_Vol2_1440x620_HIRES1.jpg">
<div class="help">
<div class="container">
<a href="#" class="button-open">
<i></i>
<span>Contact</span>
</a>
<div class="form">
<div class="header">How can we help you?</div>
</div>
Any help is much appreciated!!

How to add (Download on The App Store) Button in NopCommerce?

I'm trying to add (Download on The App Store) buttons (for both the app store and google play) in my nopcommerce website footer.
Any idea on how I can get it done?
Like This One
I'm not sure if any plugin is available for your requirement. But I can give you a reference to modify your code.
Go to: Presentation > Nop.Web > Views > Shared > Components > Footer > Default.cshtml
After the div <div class="footer-block follow-us"> add your code:
<div class="footer-block information">
<div class="social">
<div class="title">
<strong>Download it from</strong>
</div>
<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" width="140" height="auto" />
</div>
</div>
It will display as below, also you can add for app store.
Perhaps, you can create a separate partial view and use here; that'd be the best practice instead displayed here.
Also, I'm not good in css, so didn't make much effort.

Changing number of columns on wordpress blog page

This is a real rookie question. Apologies in advance.
I am looking to change the following blog page from 3 columns to 2 columns.
https://www.marriedin.co.uk/wedding-hacks
I have been viewing source in the inspector in Chrome. My thinking was that I could simply edit the following:
<div class="blog-archive blog-archive--grid" data-columns="2">
This may not work but this is what I planned to try. My problem is that I do not know which file this would be in when I access the site through an SFTP client. Is there any way to work this out from the inspector?
Thanks very much
Hey there may be a simple way in your Theme Options to change this to two columns but in case it isn't you could edit the template files. Your blog template is most likely under archive.php or index.php in your theme folder.. although you should have a look at here if you should have trouble locating the file to edit.
Somewhere in the blog template file these divs are being generated which you can see when you inspect your site.
<div class="col-md-4"> </div>
<div class="col-md-4"> </div>
<div class="col-md-4"> </div>
These are bootstrap elements that make 3 columns. Take a look here if you are not familiar with bootstrap.
To make it 2 columns like you want, change the "col-md-4" classes to "col-md-6".
That should do the trick, hope it helps.

Get gumby.js rolling with meteor

I'm trying to get the Gumby.js library to work with Meteor, but cant get it to work.
I've tried both installing it manually in /client/lib folder and using 'mrt add gumby'.
The CSS part seems to work pretty fine with the grid working perfectly, but the JS modules dont work.
I'm setting a responsive Navbar just like this
<template name="nav">
<div class="row navbar centered" id="nav1">
<!-- Toggle for mobile navigation, targeting the <ul> -->
<a id="nav-toggle" class="toggle" gumby-trigger="#nav-ul" href="#"><i class="icon-menu"></i></a>
<ul id="nav-ul" class="eight columns">
<li>Quienes somos</li>
<li>Marcas</li>
<li>Servicios</li>
<li>Laboratorios</li>
<li>Contacto</li>
<li>Otros</li>
</ul>
</div>
</template>
but the menu just does not popup on mobile width. And other modules like Folders and skip dont work at all when defined.
you can see a sample here
any idea on how to get it up and running?
Not sure about the real situation, because the js files are packed in the website and it's hard for me to tell from the source code. However, there is some clue you may find useful.
I assume you want to run the js script after the template is rendered. In this case, you need to write like this.
Template.nav.rendered = function() {
// Run the js to render the dropdown or whatever.
}
This is the Meteor programming paradigm. If you simply run the js files directly, the template may not be ready when you run that part of the code. The "rendered" callback is the place you need to place some actions after this template is ready.
In addition, you can refer the official document here http://docs.meteor.com/#template_rendered

Plone 4.2 - manually editing a diazo theme in order to change the default logo

I have installed a diazo theme for my Plone site. Now I need to change the default logo that is being used. In another question I was instructed to look at the rules.xml and index.html files that come in the theme's directory and to figure out how to change the logo by editing one of those files manually. However, I cannot figure out how to do this. These appear to be the relevant lines from my index.html file:
<div id="portal-header">
<div id="portal-slogan">
<span class="heightImmitator"></span><span>Free Theme for Plone</span>
</div>
<a id="portal-logo" title="Site1" href="/"><span class="heightImmitator"></span><img src="images/logoSchools.gif" alt="" title="" height="71" width="402"></a>
<div id="portal-personaltools-wrapper">
<h5 class="hiddenStructure">Personal tools</h5>
<dl class="actionMenu deactivated" id="portal-personaltools">
<dt id="anon-personalbar"><a style="cursor: pointer;" class="link-overlay" rel="#pb_1" href="/login" id="personaltools-login">Log in</a></dt>
</dl>
</div>
</div>
And these appear to be the relevant lines from my rules.xml file:
<copy css:theme="#portal-logo" css:content="#portal-logo" attributes="href"/>
<copy css:theme="#portal-logo" css:content="#portal-logo" attributes="title"/>
<replace css:content="#portal-logo img" css:theme="#portal-logo img" />
I guess that the "replace" line is telling the theme to replace one logo with another. However, it is not intuitive to me how I should edit these files to find the logo that I have uploaded. Incidentally, the image file that I have uploaded is called nav-home1.png and it is sitting in a directory called site-images which is in my home directory.
If I were you (and taking my comment about where to do this above into account), I'd simply remove the <replace /> rule that's trying to pull Plone's logo in from the content and then edit your index.html to reference your image file directly (at this point, it's all just plain HTML).
Incidentally, you may benefit from reading a bit more about the Diazo rules and what they do, on http://diazo.org/. For a heads-up (even if textual) of what the in-Plone experience will be in Plone 4.3, see http://pypi.python.org/pypi/plone.app.theming.
Martin
My solution was to place my image file in the ~/Plone/buildout-cache/eggs/quintagroup.theme.schools-6.0.10-py2.7.egg/quintagr‌​oup/theme/schools/static/images directory and then comment out the line in rules.xml that tells index.html to replace the image, and then edit index.html so that it loaded my image instead of logoSchools.gif, which was previously indicated. This did the trick, but now my problem is that the theme is getting the sizing information from somewhere else, so the image is far too big. Adjusting the height and width attributes in index.html have no effect.
I would suggest getting the static theme files provided by the theme egg. Then editing and packaging it as a zipped file (Use as guide -> http://pypi.python.org/pypi/plone.app.theming/1.0#packaging-themes). Then you can upload it from the Diazo control panel.
If you want to manipulate the zipped files within Plone, you can go to portal_resources in the ZMI and edit the files there. If you want to distribute the edited files, download it from the Diazo panel.
This is a bit of work for now, but the experience should dramatically change in Plone 4.3 as suggested by optilude.
For help in understanding Xpath, use: http://www.w3schools.com/xpath/default.asp Spend some time on the tutorials. It is really simple to understand.
I uploaded my logo image to the FS. I've got a develop-egg in {ZEOHOME}/src/
So, the image shows up like this:
/usr/local/Plone/zeocluster/src/quintagroup.theme.sunrain/quintagroup/theme/sunrain/static/images/theme_rain/PF-Sig.png
(See buildout tutorial for how to add a develop egg...)
In the theme's ..theme/sunrain/static/index.html file, use a direct reference like this:
<img src="/++theme++quintagroup.theme.sunrain/images/theme_rain/PF-Sig.png" alt="" title="PF Sig Logo" height="150" width="300"/>
The sizing info is right there in the <img.. /> tag.
However, it seems to be important, after making any changes, to go to Plone's Theme Control Panel, and deactivate/reactivate the theme, so that it will re-process the Rules.
I have spent the past six hours trying to change the logo in a fresh Plone 4.2 (OK, I'm a bit rusty!)
Quintagroup just tells me to customize logo.png in the ZMI, but that seems so... 2002 ;-) I spent hours yesterday trying to use the 4.3 theme-TTW feature, only to find that SunRain seems to break when I create a TTW copy.
Since this seems to be a top user request, why is it still so absurdly hard to figure out?
Should this not be a simple "Upload your new Logo Image" in the Themes Control Panel?

Resources