My View Cart and Checkout section next to the search bar at the header is missing.
The other day, I changed the code in:
catalog/view/theme/default/template/common/header.twig
At first, I took away the {{ cart }} in line 77, but after that, I put it back, but still the section is missing.
I attached the image:
Related
I am using the Shopify Cookie Compliance Banner (https://shopify.dev/themes/trust-security/cookie-banner) and have followed the setup exactly to display a Cookie Consent Bar on my store.
I've created the cookie-banner.liquid snippet in the snippets directory and have added the following code inside the body tags of the theme.liquid file as instructed:
{% render 'cookie-banner' %}
Unfortunately, it's not showing up in my store. When removing the fist line of code from cookie-banner.liquid snippet: (#cookies-banner { display: none; ... }) it does display, but doesn't remember the users preference and pops back up every time the page is refreshed or re-visited.
Any idea of why this might be happening? I am located in Australia if that makes any difference.
I want to add customer first name on Journal theme top menu module. I am adding {{ text_logged }} in top-menu.twig but it can not get text_logged from controller. How can I get text_logged from catalog/controller/common/header.php?
{% if logged %}
{{ text_logged }}
{% endif %}
$data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/account', '', true), $this->customer->getFirstName(), $this->url->link('account/logout', '', true));
I want to see "Hello John Do" on Journal theme top menu $ US Dollar instead
I had contacted the developer regarding the same issue for the journal theme v3. They told me that it can be displayed using this:
Welcome back, {{ $customer_firstname }} {{ $customer_lastname }} !
to show customer firstname and lastname in menu items.
I have integrated that into my code, and it now shows the customer name, when logged in. No need to edit OC MOD
You need to add your code using ocmod or vqmod to the Journal theme common/header.tpl. I highly recommend do not change the Journal's core codes because of ridiculous cache system (even devs couldn't get rid of it). Also here is a solution : You can edit this one for your purpose
I posed a question and got a quick response (thanks, Bob!) on how to do pagination in Django:
Change value for paginate_by on the fly
However, as outlined below, I'm having an issue getting the items per page to remain set.
I modified my ProdListView.html template to show buttons with page numbers, but, while it works, I'm getting an odd behavior. I have a for loop that I use to put out the page numbers as buttons:
{% for i in DataPaginated.paginator.page_range %}
{% if DataPaginated.number == i %}
<button class="w3-button w3-amber">{{ i }} </button>
{% else %}
{{ i }}
{% endif %}
{% endfor %}
If the pagination is set to the default of ten this works properly and shows three pages (there are 24 items). If I change the pagination to 20, it looks correct at first and shows two pages. However, if I click on the second page, it changes my pagination back to 10, shows three pages again, and places me on the 2nd of the three pages.
In the interest of space, you can find the code I'm using in the views.py file and template file, besides the fragment above, in Bob White's answer here:
Change value for paginate_by on the fly
I would like whichever items per page is picked in the form to stay set while the user pages through the output until/unless they choose to change the items per page again. Is there something I can do to keep my pagination (items per page) locked at the setting chosen with the form?
Thanks--
Al
Looking at the code in the views, you have a line: paginate_by = request.GET.get('paginate_by', 10) or 10, but I don't see in your template that you're sending paginate_by query param?
This will basically reset your pagination to 10 if you don't explicitly provide it.
My Problem
I am building a Jekyll static site using the jekyll-materialize-starter-template.
The home page contains an h1 title in the front center:
Which reads Your awesome title, and defined in _layouts/home.html:
<h1 class="header center orange-text">{{ site.title }}</h1>
How can I set the value of site.title?
What have I tried
Searched for site.title and title
Read the docs about variables
Hard-code my title. Works, but it feels like the wrong thing to do - variables should be properly set.
My question
How can I set the site.title variable used by a Jekyll template?
Edit _config.yml and locate the title key:
title: Starter Template
or
title: Your awesome title
and change that value.
If you are developing with a local server, restart the jekyll server to reflect changes to config.
I am trying to use django-sitetree but I don't understand how to do step 3 which is:
"Go to Django Admin site and add some trees and tree items."
How to make a sitetree in the admin panel? I believe the first step is to choose an alias for the "Site Tree" you are about to add.
The next step is to add "Site Tree Item". On this page you have to choose parent, title, url. Considering my app is dynamic with url structure like this localhost:8000/categoryname/entryname how do I choose urls?
By the way I am trying to add breadcrumbs in my templates.
To create a tree:
Goto site administration panel;
Click +Add near 'Site Trees';
Enter alias for your sitetree, e.g. 'maintree'.
You'll address your tree by this alias in template tags;
Push 'Add Site Tree Item';
Create first item:
Parent: As it is root item that would have no parent.
Title: Let it be 'My site'.
URL: This URL is static, so put here '/'.
Create second item (that one would handle 'categoryname' from your 'categoryname/entryname'):
Parent: Choose 'My site' item from step 5.
Title: Put here 'Category #{{ category.id }}'.
URL: Put named URL 'category-detailed category.name'.
In 'Additional settings': check 'URL as Pattern' checkbox.
Create third item (that one would handle 'entryname' from your 'categoryname/entryname'):
Parent: Choose 'Category #{{ category.id }}' item from step 6.
Title: Put here 'Entry #{{ entry.id }}'.
URL: Put named URL 'entry-detailed category.name entry.name'.
In 'Additional settings': check 'URL as Pattern' checkbox.
Put '{% load sitetree %}' into yor template to have access to sitetree tags.
Put '{% sitetree_menu from "maintree" %}' into your template to render menu.
Put '{% sitetree_breadcrumbs from "maintree" %}' into your template to render breadcrumbs.
Steps 6 and 7 need some clarifications:
In titles we use Django template variables, which would be resolved just like they do in your templates.
E.g.: You made your view for 'categoryname' (let's call it 'detailed_category') to pass category object into template
as 'category' variable. Suppose that category object has 'id' property.
In your template you use '{{ category.id }}' to render id. And we do just
the same for site tree item in step 6.
In URLs we use Django's named URL patterns (documentation). That is almost idential to usage of Django 'url' tag in templates.
Your urls configuration for steps 6, 7 supposed to include:
url(r'^(?P<category_name>\S+)/(?P<entry_name>\S+)/$', 'detailed_entry', name='entry-detailed'),
url(r'^(?P<category_name>\S+)/$', 'detailed_category', name='category-detailed'),
So, putting 'entry-detailed category.name entry.name' in step 7 into URL field we tell sitetree to associate that sitetree item with URL named 'entry-detailed', passing to it category_name and entry_name parameters.
I hope this description should fill the documentation gap %)