Let me assume that I have the following architecture
_components (folders)
x1.html
x2.html
x3.html
I have a first page where I got the information from the YAM section for every component.
At this point I would like to add a link for every component to another page where I will display the component in a bigger manner.
So, let me assume I have, in the first page :
<div class="col-md-1">
<span id= "logos" class="material-icons"></span>
</div>
and In the componentbig.html I would like to open the right component on the basis of the link.
Do you have any suggestions for me ?
If I understand You correctly, then collections might be the feature You are looking for. For example, I'm usually using collections to generate a list of products and then have a specific page for each product also. Also make sure You check the easy tutorial by Ben Balter.
Related
I am trying to print each row in the picking ticket on a separate page and for now, am using the Row height to move each item to a new page but this is something not professional cuz when I made any change in the template the format is totally changed and this solution will not work so, I am looking for a style to make this solution more dynamic whatever the changes that may happen to the other tables in the PDF.
You can use the css property page-break-after: always for this purpose.
e.g.
<style>
div.ps { page-break-after:always}
</style>
...
<div class="ps">
... ps details
</div>
This is my problem: i have this html
as you can see there are two <div class="sc-fjhmcy dbJOiq flight-information"></div> and, i want to get the element using the class attribute, but only with the flight-information value, because
I think the part that is written as nonsense code ("sc-fjhmcy dbJOiq...) change daily
I have already tried with this xmlpath, $x('//div[contains(#class, "flight-information)"'], but its not working,
What could I do?...
I checked your code and I think that there is no big issue with this.
You need to use one class name to get the element, not two names, as below.
$(".sc-fjhmcy")
Then, this will be run correctly.
Best regards
How to deliver the data to the detail page ?
You see the below demo I write, I am studying Framework7, but I am puzzle about to deliver data to the detail page.
Such as I click the first item, I want to deliver the index = 0 to the detail page, if I click the second item, I want to deliver index = 1 to the detail page.
My code is below:
<ul>
<li class="item-content">
<div class="item-media"><img src="http://up.qqjia.com/z/25/tu32695_9.jpg" width="44"></div>
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">Daniel</div>
</div>
<div class="item-subtitle">CEO</div>
</div>
</li>
...
</ul>
You see,I goto the about page is use <a> label, so, How can I deliver the index number, and so I can dynamic set the about page's data.
If there get a demo, maybe that explain more detail.
I opted for an easier way.
Set the data attribute on the 'a' tag:
<a href="#nextpage" data-myfieldname="myfieldvalue">
Then retrieve the data from the Javascript's click event handler:
mydata = $(this).data('myfieldname');
My friend, please use Template7, Framework7 already support what you are asking for, check "Pass Custom Context" section in Template7 documentation page:
http://framework7.io/docs/template7-pages.html#pass-custom-context
It is very simple and the documentation covers all the scenarios, more info and demos here:
http://idangero.us/template7/
EDIT
As some links are dead, referring to new links:
http://framework7.io/docs/template7.html
you can use localstorage concept. When the user click the particular list item like below
save localstorage :
localStorage.setItem("listitem", "1");
get localstorage :
alert(localStorage.listeitem)
Is it possible to force the sitemap control to render the menu when the current action is not listed in the MVC.sitemap file?
I have a simple top nav. When the current action is in the sitemap, the call to .Menu() will render the correct <ul><li>.. data. However, if I got to a page that is not in the sitemap such as /Home/Login, then it will not render any html at all (not even a comment, just empty space). This isn't an [authorize] issue; the menu is fine when i'm in '/Home/Index'.
It seems like it should render what was requested, but just not set the IsCurrentNode and IsNodeInPath properties. Here is the call I am making
<div id="main-nav">
#Html.MvcSiteMap().Menu(0, true, true, 1)
</div>
The Mvc.sitemap file:
<mvcSiteMapNode title="Home" controller="Home" action="Index">
<mvcSiteMapNode title="Form New Human" controller="Person" action="Create"/>
<!-- there is no mvcSiteMapNode for "Home" "Login" -->
</mvcSiteMapNode>
Found the way around it. It apparently isn't a built in extension method, or at least I couldn't find one. You could call Html.MvcSitemap().Menu(Html.MvcSiteMap.Provider.RootNode,...) but I didn't want to instantiate the helper twice.
<div id="main-nav">
#{
var sm = Html.MvcSiteMap();
#sm.Menu(sm.Provider.RootNode, true, true, 2); // 2 levels (home, plus main nav)
}
</div>
Looking around in the disassembly seems to show that it works a little like this:
You really need a starting node
If you don't give it one, it tries to find one based on the current node
plus restrictions (forward searching, depth restrictions, etc)
if you want nodes from level 1, you have to know what level you are on
Since that returns null, starting node is null, which means the helper writes an empty string
There may be a combination of tricks, or an overload or two, which can be finagled into doing this, but I can't find it right now. This works for my needs (simple top menu). There has to be a simpler way to do this, something with wild cards, or route based, with a closest match thing going on. I figured menus were a fairly standard part of a web app, and this would be covered :)
I am using ExpressionEngine 2.2.1 and am trying to create a conditional that will cause a page to show a specific navigation template based on the page's category. For example, I am creating a public profile for someone who is a part of a competition in London. When someone visits his profile, I would like the page to show, not only his profile, but also a banner with an image of London & navigation that is specific to the London competition. I would like to do this by adding a conditional with categories since we have so many competitors in many different cities. I have created a category titled "London Competitors English" and it has the ID of "56". Once I have created the competitor's profile within EE, I select the category, "London Competitors English," however, when I go to the page, the default navigation template is loading rather than the London template. I created code based on my research and most related example here: http://expressionengine.com/forums/viewthread/185555/. What do I have wrong in my code?:
FILE ONE: (condensed portion of) competitor_profiles_en/index.html where "competitor_profiles_en" is the template:
{exp:channel:entries limit="1" url_title={segment_2} }
{embed="includes/header"}
<div class="xx">
<h2>{competitor_first_name}<br>{competitor_last_name}</h2>
...
</div>
{/exp:channel:entries}
FILE TWO: (condensed portion of) my header.html file :
{if segment_1 == 'home'}
{embed="includes/_nav_landing"}
{if:elseif "{categories}{category_id}{/categories}" == "56"}
{embed="includes/_nav_city_lon_en"}
{if:else}
{embed="includes/_nav_internal"}
{/if}
The problem is that embeds are processed after all other tags, in a completely separate process. So when your includes/header embed runs, it has no categories to speak of, because it's not actually running within a Channel Entries tag.
Unless you need to pass variables to includes/header (which you don't appear to be doing here, but you may have removed that for simplicity), I'd move your includes/header to a snippet instead, so it will be processed inline with your Channel Entries tag.
Derek's answer was spot on, and I would like to elaborate on my method of putting his suggestion into action.
I found information about snippets here http://expressionengine.com/user_guide/templates/globals/snippets.html and watched this tutorial here http://www.youtube.com/watch?v=AEEudo0BrRA&feature=related. I then created a snippet within the control panel (Design > Templates > Snippets) that included all of the code that was in the header file and titled it snippet_header_en. Because ExpressionEngine includes snippets as a part of the template that they are in, EE recognized my conditional including the categories that I created. Here is the revised code:
FILE ONE: (condensed portion of) competitor_profiles_en/index.html where "competitor_profiles_en" is the template:
{exp:channel:entries limit="1" url_title={segment_2} }
{snippet_header_en}
<div class="xx">
<h2>{competitor_first_name}<br>{competitor_last_name}</h2>
...
</div>
{/exp:channel:entries}
FILE TWO: (condensed portion of) my header.html file :
As previously mentioned, I moved this code to the snippet section of the EE control panel.