I am trying to display the most recent 15 weblog entries and the most popular 15 weblog entries in ExpressionEngine, this is my code and it gives me blank blocks, any ideas ?
<div id="footseparator_05" class="foot">
{exp:weblog:entries orderby="date" sort="desc" limit="15" disable="categories|custom_fields|member_data|pagination|trackbacks"}
<div id="footbullet_00"></div>
{title}
<div id="footseparator_06"></div>
{/exp:weblog:entries}
</div>
<div id="footseparator_07"></div>
<div id="footseparator_08" class="foot">
{exp:weblog:entries orderby="view_count_one" sort="desc" limit="15" disable="categories|custom_fields|member_data|pagination|trackbacks"}
<div id="footbullet_01"></div>
{title}
<div id="injected_01"></div>
{/exp:weblog:entries}
</div>
This code is located in one page BTW, thanks for your time :)
Try adding dynamic="off" to both tags. (See the docs on this tag here.)
Related
I have a layout container that shows items like this:
My code:
<div fxLayout="column" fxFlex="50">
<div fxLayout="row wrap" fxLayout.xs="column wrap" fxLayoutAlign="center center">
<button mat-stroked-button color="primary" fxFlex="1 3 30" *ngFor="let category of categories">{{category.DISPLAY | translate}}</button>
</div>
</div>
I would like the row to wrap the items based off the space available. In this case, I would like the "Email" category to take up the entire space of the newly wrapped row. Any help would be appreciated.
simple example
<div fxLayout="row wrap" fxLayoutAlign="center center" >
<button mat-stroked-button color="primary" fxFlex="3 0 33.3" *ngFor="let i of [1,2,3,4]">aaaaaaaaa</button>
</div>
I want to scrape a web page (German complaint website) using BeautifulSoup. Here is a good example (https://de.reclabox.com/beschwerde/44870-deutsche-bahn-berlin-erstattungsbetrag-sparpreisticket)
<div id="comments" class="kt">
<a name="comments"></a>
<span class="bb">Kommentare und Trackbacks (7)</span>
<br><br><br>
<a id="comment100264" name="comment100264"></a>
<div class="data">
19.12.2011 | 11:04
</div>
von Tom K.
<!--
-->
| <a class="flinko" href="/users/login?functionality_required=1">Regelverstoß melden</a>
<div class="linea"></div>
TEXT I AM INTEREST IN<br><br>MORE TEXT I AM INTEREST IN<br><br>MORETEXT I AM INTEREST IN
<br><br>
<a id="comment100265" name="comment100265"></a>
<div class="data">
19.12.2011 | 11:11
</div>
von Tom K.
<!--
-->
| <a class="flinko" href="/users/login?functionality_required=1">Regelverstoß melden</a>
<div class="linea"></div>
TEXT I AM INTEREST IN<br><br>MORE TEXT I AM INTEREST IN
<br><br>
<a id="comment101223" name="comment101223"></a>
<div class="commentbox comment-not-yet-solved">
<div class="data">
25.12.2011 | 10:14
</div>
von ReclaBoxler-4134668
<!--
--><img alt="noch nicht gelöste Beschwerde" src="https://a1.reclabox.com/assets/live_tracking/not_yet_solve-dbf4769c625b73b23618047471c72fa45bacfeb1cf9058655c4d75aecd6e0277.png" title="noch nicht gelöste Beschwerde">
| <a class="flinko" href="/users/login?functionality_required=1">Regelverstoß melden</a>
<div class="linea"></div>
TEXT I AM NOT INTERESTED IN <br><br>TEXT I AM NOT INTERESTED IN
</div>
<br><br>
<a id="comment101237" name="comment101237"></a>
<div class="data">
25.12.2011 | 11:01
</div>
von ReclaBoxler-3315297
<!--
-->
| <a class="flinko" href="/users/login?functionality_required=1">Regelverstoß melden</a>
<div class="linea"></div>
TEXT I AM INTERESTED IN
<br><br>
etc...
<br><br>
<br><br>
</div>
I was able to scrape most of the content I want (thanks to a lot of Q&A's I read here:-)) except for the comments (<div id="comments" class="kt">) which are not in a class ="commentbox" (I got the commentboxes already with another command). The comments outside the comment boxes seem to be not in a normal tag, that's why I just did not manage to get them via "soup.find(_all)". I'd like to scrape these comments as well as information about the person posting the comment ("von") as well as the date and time (<div class="data">).
It would be absolutely fantastic if someone knows how to solve this one. Thanks in advance for your help!
The common task to extract all texts from a page as follows
from urllib.request import Request, urlopen
from bs4 import BeautifulSoup
doc = """xxxxxxxx""" // url name
soup = BeautifulSoup(doc, "html.parser")
print(soup.get_text())
I'm new to flexbox and it seems really complex compared to bootstrap. I have a splash screen where I am required to vertically and horizontally center a content:
<div layout="row" layout-align="center center">
<div layout="row" layout-wrap>
<div flex="30">
<img ng-src="images/logo.png" src="//:0" alt="example.com" title="Example" />
</div>
<div flex="45">
<h2 class="title">example.com</h2>
</div>
<div flex="25">
<h1 class="bang">Bang!</h1>
</div>
</div>
</div>
however it doesn't center till I add a height to it:
style="height:500px"
Why does it behave this way? Is my code wrong? This doesn't seem like the right way of doing it.
Also with the items in my second row with the layout-wrap the last div with flex=25 overlaps the second div with flex=45.
Basically what I want to do this vertically and horizontally center a div and be able to split that div into as many columns as I like while maintaining a responsive width that adjusts depending on screen size.
Maybe this can point you in the right direction - CodePen
Markup
<div ng-controller="AppCtrl" ng-cloak="" ng-app="MyApp" layout-fill layout="row" layout-xs="column" layout-align="center center">
<div flex="30">
<img ng-src="images/logo.png" src="//:0" alt="example.com" title="Example" />
</div>
<div flex="45">
<h2 class="title">example.com</h2>
</div>
<div flex="25">
<h1 class="bang">Bang!</h1>
</div>
</div>
I am using ExpressionEngine 2.10.3 and also Taxonomy 3 plugin. I have the following code which, when run, returns the 15 nodes I have set up:
<div class="col-md-4">
{exp:taxonomy:nav tree_id="1" display_root="no" root_node_id="2"}
<li>
{node_title}
</li>
{/exp:taxonomy:nav}
</div>
What I would like to do is after every 5 entries, end the current <div> and start a new col-md-4. Usually, I would use {switch} and I have tried it like this:
<div class="col-md-4">
{exp:taxonomy:nav tree_id="1" display_root="no" root_node_id="2"}
<li>
{node_title}
</li>
{switch='||||</div><div class="col-md-4">'}
{/exp:taxonomy:nav}
</div>
But it doesn't work at all, instead it just prints out {switch='||||'}
Is there any way of doing what I'm trying to do?
If you're on 2.7.1 or greater and your taxonomy:nav has the nav_count variable, use the modulo operator. Instead of your {switch...} thing, put
{if nav_count % 5 == 1}
</div><div class="col-md-4">
{/if}
If you end on an modulo-5 count, though, you're going to have an empty div....
Using the sparkup plugin for vim (specifically vim-gnome on Ubuntu 15.04, although I doubt that matters), I am generating a list with item numbers:
ion-content.has-tabs > .list > a.item[href=#/item/$]{Item $}*3
The result substitutes the item number in [href=#/item/$] but not in {Item $}:
<ion-content class="has-tabs">
<div class="list">
Item $
Item $
Item $
</div>
</ion-content>
Feature, bug, or user error?
I don't remember Sparkup ever supporting incrementing numbers inside "content" braces so I would say "feature".
Don't waste your time asking for a fix on the plugin's issue tracker, though.
I am afriad that this plugin deems the $ in curly braces as a text which should not be affected. To numerate your Item $ list, you can try this command
:let #a=1 | %s/\$/\=(#a+setreg('a',#a+1))/g
or for selected block in visual mode
:let #a=1 | '<,'>s/\$/\=(#a+setreg('a',#a+1))/g
I accepted an answer to the question as I asked it, but I'm adding this to show an alternate approach for a slightly different requirement. I needed to add a nested tag along with the text, which Sparkup does not support. So I found a single 2-step solution to this that also solved the original item number problem (more complex in my real world solution but simplified here).
This sparkup:
ion-content > .list > a.item.item-icon-left.Item$[href=#/items/$]*3 > i.icon.ion-email
generates this:
<ion-content>
<div class="list">
<a href="#/items/1" class="item item-icon-left Item1">
<i class="icon ion-email"></i>
</a>
<a href="#/items/2" class="item item-icon-left Item2">
<i class="icon ion-email"></i>
</a>
<a href="#/items/3" class="item item-icon-left Item3">
<i class="icon ion-email"></i>
</a>
</div>
</ion-content>
Then after I select the lines in visual mode, running this:
:'<,'>s/ Item\([0-9]*\)">/">Item \1/g
produces my desired result:
<ion-content>
<div class="list">
<a href="#/items/1" class="item item-icon-left">Item 1
<i class="icon ion-email"></i>
</a>
<a href="#/items/2" class="item item-icon-left">Item 2
<i class="icon ion-email"></i>
</a>
<a href="#/items/3" class="item item-icon-left">Item 3
<i class="icon ion-email"></i>
</a>
</div>
</ion-content>