ModX Evo Wayfinder: Show 1st and 3rd level reources, but not 2nd? - content-management-system

I am using WayFinder to show particular resources with '&includeDocs'. EG:
[[Wayfinder? &startId=0&level=0&includeDocs=1,3]]
However, this wont show resources whose parents arent in that list, eg:
<ul>
<li>Level 1 - ID1: Show me
<ul>
<li>Level 2 - ID2: Skip me
<ul>
<li>Level 3 - ID3: Show me</li>
<ul>
</ul></li>
</ul></li>
<ul>
So in this example, even though Ive specified I want to show resources 1 and 3, 3 will not show unless I show 2 as well.
Would anyone know how to fix this or if there is a better way of doing this?

use
&parentRowTpl=`parentRow`
and ParentRow chunk must be:
[[+wf.wrapper]]

Related

Locators combination

I am working on protractor to test the AngularJs application. Here I came across one scenario where I want to click on image for different users. But the id for image is same for all (say 10) users. So I found one more element that is one unique number allocated to each user. The code for 2 different users are:
USER1:
img id="searchPatientImgAdmittedM" class="img-circle picwidth" ng-click="getPatientVitalLabPharmacy(patient.patientId._id)" onclick="ShowHide(this)" src="icons/male.png" alt="" role="button" tabindex="0"
span class="clearfloat ng-binding">12339/span
USER2:
img id="searchPatientImgAdmittedM" class="img-circle picwidth" ng-click="getPatientVitalLabPharmacy(patient.patientId._id)" onclick="ShowHide(this)" src="icons/male.png" alt="" role="button" tabindex="0"
span class="clearfloat ng-binding">8841/span
EDIT:
The full HTML code
<div class="col-md-10 col-sm-9 col-xs-9 skin-font-color paddingTop7">
<span class="skin-font-color">
<span class="name clearfloat ng-binding">KRISHA</span>
<span class="clearfloat ng-binding">12348</span>
<img id="searchPatientImgAdmittedF" class="img-circle picwidth" ng-click="getPatientVitalLabPharmacy(patient.patientId._id)" onclick="ShowHide(this)" src="icons/femaleImages.jpg" alt="" role="button" tabindex="0">
</div>
I tried to do :
element(by.id('searchPatientImgAdmittedF')).all(by.tagName('‌​12348')).click();
// or
element(by.id('searchPatientImgAdmittedF')).element(by.tagNa‌​me('12348')).click()‌​;
How can I make combination of locators to click on this users. Only image part is clickable.
Thanks four your additions.
Now you're trying to click on a sister-element. There are several approaches to do so.
The one I'm usually using is:
element(by.cssContainingText('span.clearfloat','12348')).element(by.xpath('..')).$('#searchPatientImgAdmittedF').click();
//equal to
element(by.cssContainingText('span.clearfloat','12348')).element(by.xpath('..')).element(by.id('searchPatientImgAdmittedF')).click();
This evaluates first the identifiable tag with the unique number, then climbs up to its parent element, then from there gets the img-element with the ID.
The $() selector
The cssContainingText() selector
Another option would be to use isElementPresent(), which evaluates the existence of a child-element. However, the code is (from my point of view) more complex and I don't see, how cssContainingText() could be used there, so I don't try to do it here.
Thanks for your quick help in solving my issue. I want to add here that I found the answer to my problem and now I am able to click on the particular user I want from the list of many users. The code I am using is :
element(by.cssContainingText('span.clearfloat','12339'))
.element(by.xpath('/html/body/div[3]/div[1]/div[17]/div/div/table[4]/tbody/tr[3]/td[1]/div[1]/img'))
.click();
This is finding the child element first and then the parent element.The id was all same for all the users so it was not taking that and so I used only xpath along with unique number.
Thanks again for the help.

jquery .html() returning null in ie7

On click li element i am getting the current element value and appending it into another div dynamically.Its working fine in all browsers.But returning null in IE7.I don`t the reason that why its happening?Please can any one give me a solution for this..Part of the code only i pasted here.
Sample code:
////////////.//This line returning null in IE7./////////////////
$('#pagelink_a #pagelinkli_'+tab_lastid_val).html()
(tab_lastid_val value can be a 1 or 2 or 3.Clixked li element value comes here)
<div class="pagelink">
<div id="pagelink_a">
<ul>
/******** all li element are clickable***********/
<li id="pagelinkli_1"><a>Google</a></li>
<li id="pagelinkli_2"><a>Chrome</a></li>
<li id="pagelinkli_3"><a>Firefox</a></li>
</ul>
</div>
</div?
try this:
$('#pagelink_a').find('li[id=pagelinkli_'+tab_lastid_val']').html();
code is not tested but i think it should work.
Given your html layout, your parent div is .pagelink not #pagelink_a , so replace your following line:
$('#pagelink_a #pagelinkli_'+tab_lastid_val).html()
for this one:
$('.pagelink #pagelinkli_'+tab_lastid_val).html()
Just use
$('#pagelinkli_'+tab_lastid_val).html()
The # tag identifies an ID which only a single element may have. There is no need to have anything preceding it. You also labeled the previous class as id, which is wrong. I don't know how your other browsers managed to get anything.
Although bit off topic, it may be better to actually drop IE7 support entirely. Due to small user base and decreasing popularity, it may be costing you more money by support it than to not support it.
Try instead of html() , and try append().
For example
$('#ID').append('Your content');

How to get first and last items number with Zend Paginator?

I need to get the fisrt item and last item number in my view.phtml.
The trouble is that I can't acces this properties in my pagination control, because of the structure of the html. For example:
<div class="list">
.... rows ...
<div class="items"> 1 - 18 of 540</div>
</div>
<div id="pagination">
<?php echo $this->paginator; ?>
</div>
Is there anyway to access to those properties from the view? I just can't figure out how can I do it.
First item will be 1 and last item count would be $paginator->getTotalItemCount();
There is example code in the Zend documentation, where first and last page links are generated.
$this->paginator->first;
$this->paginator->last;

Email travel package info from user (CMS Made Simple, CGECommerce, Cart, Products, etc.)

I am using CMS Made Simple along with all of Calguy's plugins for e-commerce(Products, Orders, Cart, etc.)I can't quite figure out how to make what I need. How can I make a form with items from the Products module and checkboxes for each, and at the end a total and lost for the checked items is sent to the owner of the site? Any pointers would be appreciated much, I can figure out the rest.
If you use the Cart Module you could try customizing a viewcart template under "Viewcart Form Templates".
Once products are selected you can use another template to put the contents of the cart in an email. Something like this can be used to create a really basic list + total listing:
{if !isset($cartitems) || count($cartitems) == 0 }
<p>No products in the cart.</p>
{else}
<ul>
{foreach from=$cartitems item='oneitem'}
<li>
{$oneitem->quantity}x {$oneitem->summary} ({$currencysymbol}{$oneitem->item_total|number_format:2})
{if $oneitem->quantity > 1}
({$currencysymbol}{$oneitem->base_price|number_format:2} each)
{/if}
</li>
{/foreach}
</ul>
{$total_text}: {$currencysymbol}{$carttotal|number_format:2}
{/if}
You can always temporarily insert {$cartitems|print_r} into your template to view the attributes that are available for use in the smarty code.

Displaying entries per category in ExpressionEngine

So, I've searched, and found a few posts that kinda get me what I want, but it still doesn't quite work. This post especially seemed closest to what I was trying to achieve, and I built my code off of it: http://expressionengine.com/forums/viewthread/168142/
To explain; I have a series of entries, each entry is assigned to only one category. I'd like to list out these categories and, beneath each category, list out the entries with one of their custom fields. Like so:
Category 1
Item 1
Item 2
Category 2
Item 1
Item 2
So, here's my code as it stands now, which lists out the categories, but doesn't spit out any of the entries at all:
{exp:channel:categories channel="faq-question" style="linear"}
<section class="faq-category-container closed">
<h1 class="faq-category-header">{category_name}</h1>
<dl>
{exp:query sql="
SELECT title, url_title AS urlt, cat_id
FROM exp_channel_titles
NATURAL JOIN exp_category_posts
WHERE channel_id = '7' AND cat_id = '{category_id}'
ORDER BY title ASC"
}
{embed="jazz-camp/faq-cat-list" faqlink="{urlt}"}
{/exp:query}
</dl>
</section><!-- end .faq-category -->
{/exp:channel:categories}
And the embedded template it references:
{exp:channel:entries channel="faq-question" url_title="{embed:faqlink}"}<!-- entry -->
<dt>{title}</dt>
<dd>
{faq_content}
</dd>
{/exp:channel:entries}
Any help would be most appreciated!
This may be a very basic example of what you're after:
{exp:channel:categories style="linear"}
<h1>{category_name}:</h1>
{exp:channel:entries category="{category_id}" dynamic="no"}
<p>{my_custom_field}</p>
{/exp:channel:entries}
{/exp:channel:categories}
So, here's what I ended up with at the end (courtesy of some help over at the EE boards):
{exp:channel:categories channel="faq-camp" style="linear" show_empty="no"}
<section class="faq-category-container closed">
<h1 class="faq-category-header">{category_name}</h1>
<div class="faq-questions-container">
<dl>
{embed="jazz-camp/faq-cat-list" faqlink="{category_id}" faqparent="faq-camp"}
</dl>
</div><!-- end .faq-questions-container -->
</section><!-- end .faq-category -->
{/exp:channel:categories}
And as for the embed, it looks like this:
{exp:channel:entries channel="{embed:faqparent}" category="{embed:faqlink}" dynamic="no"}<!-- entries -->
<dt>{title}</dt>
<dd>
{faq_answer}
</dd>
{/exp:channel:entries}
The reason for the embed has to do with how things are pulled in with regards to getting the correct channel entries; simply having the {exp:channel:entries} inline in the page didn't quite work.
The Category Archive tag might be helpful to you:
http://ellislab.com/expressionengine/user-guide/modules/channel/category_archive.html