ExpressionEngine 1.6.9: displaying a weblog at all pages - templates

I'm a EE newbie.
I have the code below. the poll weblog displays at search result page, but doesn't display at blog and post details page :/ what am I missing?
display at search result page: www.blabla.com/search/noresults/d8ee432f229715a4adfbe1cc0d21049a/
NO display at blog pages: www.blabla.com/blog/ or www.blabla.com/blog/post/lorem_ipsum_is_simply_dummy_text/
Appreciate helps!!!! Thanks a lot!
{exp:weblog:entries weblog="lg_polls"}
{exp:lg_polls:poll entry_id="29" precision="1" return="/blog/"}
<p>{poll_question}</p>
{if can_vote}
{poll_form}
{if has_voted}<p>You have already voted in this poll, however you can vote again.</p>{/if}
<ul class='lg-polls-answers'>
{poll_answers}
<li class='a-{answer_count}'>
<label for='lg-polls-answer-{answer_id}'>{answer_input} <span class='answer'>{answer}</span></label>
</li>
{/poll_answers}
</ul>
<div class="alignCenter"><input type="image" src="{site_url}/images/btn_submitpoll.png" alt="Vote" /></div>
{/poll_form}
{if:else}
{if has_voted}<p>Thanks for voting in this poll.</p>{/if}
{if restricted}<p>Sorry, You are restricted from voting in this poll.</p>{/if}
{if expired}<p>This poll ended on {expiration_date}.</p>{/if}
{if yet_to_begin}<p>This poll is yet to begin. Voting opens on {entry_date}.</p>{/if}
{/if}
{if show_results}
<div class='lg-poll-results' id='lg-poll-results-29'>
<ul class='lg-polls-answers'>
{results_answers}
<li class='a-{answer_count}'>
<span class='answer'>{answer}</span>
<span class='answer-total-votes'>{answer_total_votes} votes <b>{answer_percentage}%</b></span>
</li>
{/results_answers}
</ul>
<div class='poll-total-votes'>Total Votes: {poll_total_votes}</div>
</div>
{if:else}
{if show_results_after_poll && has_voted}The results of the poll will be made available on {expiration_date}{/if}
{if never_show_results && has_voted}The results of this poll will be made public at a later date.{/if}
{/if}
{/exp:lg_polls:poll}
{/exp:weblog:entries}

I'm not 100% sure, since I haven't used LG Polls before, but try adding in dynamic="off" to your exp:weblog:entries opening tag. That will prevent EE from trying to find entries within the weblog you're calling based on the URL. See the link below:
http://expressionengine.com/legacy_docs/modules/weblog/parameters.html#par_dynamic

Related

Zurb Foundation Accordion not expanding

I am using Foundation 6.7.4.
I am trying to set up an accordion like the one in their example here https://get.foundation/sites/docs/accordion.html
I have my accordion set up as such:
<div class="grid-x">
<div class="medium-12 cell">
<ul class="no-bullet accordion" data-accordion data-allow-all-closed="true" data-multi-expand="true">
<li class="accordion-item" data-accordion-item>
<a href="#" class="accordion-title">
My Title
</a>
<div class="accordion-content" data-tab-content>
My content
</div>
</li>
</ul>
</div>
</div>
When I click the A tag I can see the Accordion expand for a fraction of a second before closing. I can also see the CSS classes and attributes change in the inpector.
But I'm unsure why none of these are sticking and what's causing the accordion to revert its's self.
Would anyone know why?
Turned out this was because I had 2 foundation.js files referenced.

How can I click on numeric buttons (onclick Event) using selenum in python?

I have a HTML code like this:
<ul aria-hidden="false" aria-labelledby="resultsPerPage-button" id="resultsPerPage-menu" role="listbox" tabindex="0" class="ui-menu ui-corner-bottom ui-widget ui-widget-content" aria-activedescendant="ui-id-2" aria-disabled="false" style="width: 71px;">
<li class="ui-menu-item">
<div id="ui-id-1" tabindex="-1" role="option" class="ui-menu-item-wrapper">20</div>
</li>
<li class="ui-menu-item"><div id="ui-id-2" tabindex="-1" role="option" class="ui-menu-item-wrapper ui-state-active">50</div>
</li>
<li class="ui-menu-item"><div id="ui-id-3" tabindex="-1" role="option" class="ui-menu-item-wrapper">100</div>
</li>
<li class="ui-menu-item"><div id="ui-id-4" tabindex="-1" role="option" class="ui-menu-item-wrapper">200</div>
</li>
</ul>
I want to click on "200". Can u help me? I used selenium in python 2.7
I tried doing this:
import time
time.sleep(10)
x=driver.find_element_by_link_text("200").click()
x.click()
time.sleep(8)
The problem here is that the element that contains the text 200 is not a "Link", but only a li tag which could work as a clickable element was defined on that site.
The documentation doesn't specify it directly, but "Link" means only a tags.
The idea is the same, but you'll have to find that element on a different way than thinking about as a Link. Using xpath would be I think the best way for this approach:
x = driver.find_element_by_xpath("//div[./text()='200']")
x.click()
Now of course that would work for finding an element depending on the text it contains, but for finding the specific node you want would be even easier and better to use the id, as it should always be unique:
x = driver.find_element_by_id('ui-id-4')
I can run it by use of "send_keys":
import time
number.click()
number.send_keys("200")
var200=driver.find_element_by_xpath("""//*[#id="ui-id-4"]""")
var200.click()

Foundation Joyride issues

I am trying to use Foundation's joyride in my website. I took the example on Zurbs homepage like this
<ol class="joyride-list" data-joyride>
<li data-id="firstStop" data-text="Next" data-options="tip_location: top; prev_button: false">
<p>Hello and welcome to the Joyride <br>documentation page.</p>
</li>
<li data-id="numero1" data-class="custom so-awesome" data-text="Next" data-prev-text="Prev">
<h4>Stop #1</h4>
<p>You can control all the details for you tour stop. Any valid HTML will work inside of Joyride.</p>
</li>
<li data-id="numero2" data-button="Next" data-prev-text="Prev" data-options="tip_location:top;tip_animation:fade">
<h4>Stop #2</h4>
<p>Get the details right by styling Joyride with a custom stylesheet!</p>
</li>
<li data-button="End" data-prev-text="Prev">
<h4>Stop #3</h4>
<p>It works as a modal too!</p>
</li>
and then in the javsScript I initialize it like this
$(document).foundation('joyride', 'start');
I get this error on my console,
Uncaught RangeError: Maximum call stack size exceeded
Any explanations on how I am getting this error?
Sounds like the page is missing an element for Joyride to attach to. Your code contains the JoyRide modals but doesn't contain an element to attach to.
Add
<div id="firstStop">First Stop</div>
to your HTML.
Here's a working demo.

Undoing the changes Spree_fancy has done to listing products

I would like to undo the changes that spree_fancy theme has made to the listing products. In the original Spree, I received products with 'columns three' when I browsed a taxon.
<div data-hook="taxon_products">
<ul id="products" class="inline product-listing" data-hook="">
<li id="product_3" class="columns three alpha" itemtype="http://schema.org/Product" itemscope="" data-hook="products_list_item">
<div class="product-image">
<a class="info" title="Ruby on Rails Baseball Jersey" itemprop="name" href="/products/ruby-on-rails-baseball-jersey">Ruby on Rails Baseball Jersey</a>
<span class="price selling" itemprop="price">$19.99</span>
</li>
However, spree_fancy theme inserted another nested unordered list and set the class to "columns four". I would like to undo these changes. My first guess was to browse through the overrides, but I couldn't find the caused file.
div data-hook="taxon_products">
<ul id="products" class="inline product-listing" data-hook="">
<li class="product-row">
<ul>
<li id="product_18" class="columns four alpha" itemtype="http://schema.org/Product" itemscope="" data-hook="products_list_item">
<div class="product-image">
<a class="info" title="Sunflower Clip Arts" itemprop="name" href="/products/sunflower-clip-arts">Sunflower Clip Arts</a>
<span class="price selling" itemprop="price">$4.00</span>
</li>
The override happens here:
https://github.com/spree/spree_fancy/blob/596d11e09343a1ce716b4c34bcd3802765728c46/app/overrides/spree/shared/_products/group_products_list_by_3_in_row.html.erb.deface
If you place an empty file at app/overrides/spree/shared/_products/group_products_list_by_3_in_row.html.erb.deface and restart your web server, this override should not longer be applied.

foundation 4, clearing lightbox thumbs not displaying correctly

I posted a test site at http://jobajoba.org that shows some foundation 4 elements.
I am using vanilla out-of-box foundation 4 framework but having trouble with lightbox thumbs showing up as bullet items in a list (they should be in row similar to "block grid" example shown on the page).
I can't figure out what I am doing wrong... note that everything else on page seems to work out of box.
On edit:
I forgot about this question, but about a month after I posted this, Zurb indicated to me that they used a block-grid to create the effect. Something like this worked for me:
<div>
<ul class="large-block-grid-4 small-block-grid-2" data-clearing>
<li>
<a href="http://foundation.zurb.com/docs/img/demos/demo1.jpg" class="th">
<img src="http://foundation.zurb.com/docs/img/demos/demo1-th.jpg" data-caption="THIS IS CAPTION 1">
</a>
</li>
<li>
<a href="http://foundation.zurb.com/docs/img/demos/demo2.jpg" class="th">
<img src="http://foundation.zurb.com/docs/img/demos/demo2-th.jpg" data-caption="THIS IS CAPTION 2">
</a>
</li>
<li>
<a href="http://foundation.zurb.com/docs/img/demos/demo3.jpg" class="th">
<img src="http://foundation.zurb.com/docs/img/demos/demo3-th.jpg" data-caption="">
</a>
</li>
<li>
<a href="http://foundation.zurb.com/docs/img/demos/demo4.jpg" class="th">
<img src="http://foundation.zurb.com/docs/img/demos/demo4-th.jpg" data-caption="">
</a>
</li>
</ul>
</div>
Foundation's documentation examples uses a custom docs.css file:
http://foundation.zurb.com/docs/assets/docs.css
The styles for the Clearing Lightbox found under the heading /* Clearing Styles */ are exactly the same as those included in the vanilla download. However, the file also has an extra section specifically for the documentation example.
/* Clearing Docs */
.clearing-thumbs { list-style: none; }
.clearing-thumbs li { float: left; margin-right: 10px; }
Adding these rules to your own css file should provide the layout you're looking for.