In ghost, how to sticky all the featured posts on the top? - themes

I want to add the function of sticking the featured posts on the top in the first page. I found this - Custom Featured Post Styling, but this method can only sticky the posts on the top of that page which the post originally display due to the context limitation.
The {{#foreach}} helper does not perform queries, and can only operate on the data available to it in the current template scope. You can find out what data a template has access to by looking it up in the context table.
For example, if there are 3 pages and the article test is displayed on the page 2, then I mark it as featured and check the first page, however, test won't be displayed on it.
My question is: how to sticky all the featured posts, no matter where they originally display, on the top of my first page?

Related

Using one Wix Dynamic Page for various entries in the site menu

I am doing a site in Wix.com so my wife can maintain it without my input. The draft site is live at:
http://www.wingspan.info
IMPORTANT: The wife is not a techie.
Essentially, the site displays our art work in galleries of paintings, etc, filtered by artist.
I have coded one page, then duplicated that to create the galleries and filter the WixDataQuery according to Andrew or Helen and Categories like Painting, Drawing, Sculpture, iPad Art, etc. Also, where we have exhibited (Exhibitions menu) some of our paintings.
All working, but any change to design and I have to change 15 pages...
So, it now strikes me that it would be more efficient to design one dynamic page, and set up the menu to display the different categories, as it is set up in the live site:
However, I can't find any documentation that shows how to use just the one dynamic page rather than my coded page duplicated to produce 12 different pages. Not clever...
Any suggestions / tutorials where I can find how to do this?
Thanks!
Basically, you want to add the Content Manager to your site if you haven't already, and then set up a collection with all of your data in it. One row per eventual "page" that you want.
Next, you can take the page you already designed and convert it to a dynamic page. It will then have a dataset on the page which you need to connect to various elements on the page through their connect buttons.
Finally, you'll need to edit your menu to point to the various instances of your dynamic page instead of the regular pages you have them pointing to now.
You can read all about how dynamic pages work here and here.

On Joomla, how to show multiple editable articles on the same page?

I have a static website, which I want to make editable by the client. So, I decided to rebuild the website using Joomla. The current static home page uses Zurb's Foundation to display the contents in the following layout.
1st Row: 1 column,
2nd Row: 2 columns,
3rd Row: 1 column
Using Joomal, I have thought of the following options.
the whole page is 1 article: the client would need to understand html, to be able to maintain div's and classes. Isn't it?
Each column on the page (1 column on the 1st row + 2 columns on the 2nd row + 1 column on the 3rd row) is an article that the client can edit. In effect, the page displays the full contents of 4 articles in the above layout.
I think the 2nd option is the way to go. However, I could not figure out how to display multiple, FULL, EDITABLE articles on the same page. I looked at the extension (Articles Anywhere - https://extensions.joomla.org/extension/articles-anywhere). However, it seems that although this extension can display articles, they won't be editable by authorised users.
Your effort and time to answer my question are highly appreciated...
Throughout the last few days, I managed to achieve what I asked about. I thought of documenting it here for the benefit of others.
Let's say we want to create a page, which looks like the following.
1st Row has 1 column: Part-r1-c1
2nd Row has 2 columns: Part-r2-c1 & Part-r2-c2
3rd Row has 1 column: Part-r3-c1
Basically, you need to do the following.
Create a template having module positions for each "Part" of your page layout. Let's call this template "Custom Template". So, you will need to create 4 positions:
Part-r1-c1
Part-r2-c1
Part-r2-c2
Part-r3-c1
Creating a custom template is an involved process with quite a learning curve. You need to be patient until you understand how Joomla templates work. I suggest referring to the official documentation and some tutorial videos/articles. I found the following useful.
Convert an HTML Template to Joomla 2.5/3.0 (3-parts YouTube Video): https://www.youtube.com/watch?v=E13QMWgvwlA&t=3s
https://docs.joomla.org/Creating_a_basic_Joomla!_template
As an alternative to creating your own template, you can use a Template Extension (or framework). I like T3-Framework http://www.t3-framework.org/.
However, in my opinion, investing time in understanding how Joomla templates work has much higher return on investment than understanding how to customise/customize an existing framework. To build your own template, you need to be comfortable with changing php and xml files though.
Create an empty article, and call it something like "Dummy Article".
Create a menu item for your page, e.g. "Services". The type of this menu item should be "single article". Choose the "Dummy Article", which you created above, as the article to be displayed. Assign "Custom Template" to this menu item.
Create an article for each Part of your page, in which you will write the contents, which your customer would be able to change.
Create a module for each Part, and assign it to the related position of the layout, and insert the related article into this module. Inserting articles into modules is not part of standard Joomla (at the current version 3.6.4). To insert articles into modules, you need to use a Joomla extension, like https://extensions.joomla.org/extensions/extension/news-display/articles-anywhere/.
That's it.
I discovered the need for another feature, which I missed asking about in my question. I wanted to make some Parts, which are not editable by the customer. Here's how I did it.
Create a category for articles, which you don't want your customer to change. Let's call it "Protected". Change the permissions for this category to Deny access to Editors (with the assumption that you are going to provide your customer with an Editor User ID.)
Create articles for each Part of your page, in which you will write the contents, which your customer CANNOT change. Categorise these articles as "Protected."
Good Luck!
To display multiple articles on a page you can use the category blog view or the featured view or (with customization) the tagged items view. However you must not use "read more" within the articles. Make sure that the option to display edit icon is turned on and that you are logged in as a user with edit privileges for all of the articles in question. If you are an administrator, publisher or editor by default you will have these.

Joomla 3.2 - Load Component View from Specific Menu Item ID inside Another Component

I'm trying to get my head around Joomla 3.2's new framework and develop a capability/feature in a custom component (lets call it com_custom) that can load com_content's category blog view within com_custom's view, using the category blog's menu item id!
There are quite a few codes that I saw here and around the web that only load the default view of the 'imported' component, rather than the view specified in the imported component's assigned menu parameters. Also, most of these codes use deprecated functions, so I'm quite lost now.
So what I need to be able to add is:
Include a category blog view (say from menu item id 223) within com_custom's current view.
It should import all of the parameter setting of the category blog's menu item.
It should not be in an iFrame
Any help is much appreciated!!!
You can't include com_content because it makes use of the JPATH_COMPONENT constant in 14 different places, most notably in content.php (the main file that's loaded, even before the controller) and in most views, in order to load helpers.
These are the first two ways that come to mind to overcome this limitation:
Instantiate the articles model, load the data, and use your view to display it; you'll need to dig into the menu table to find the params related to your menuid; Bewre: Search engines might consider the duplicate content as spam.
Insert a jquery ajax call to get the url of the menuid adding &tmpl=component i.e.
index.php?option=com_content&view=category&id=13&Itemid=522&tmpl=component
The latter will be much easier to implement. Search Engines will NOT see the different content under different urls, since it's ajax.
Regarding the limitation, see also this question:
Joomla how can i create model from other component

Partial refresh of JSF page using ui:repeat and AJAX

I have a page say "Main Page" (Page 1) which looks like a Outlook calendar page having a large number of rows displayed using . Actually, the columns represent "Weeks" and the rows represent "Products". The functionality is that the user can choose a product week combination and create offers for the chosen week.Ideally, as we have a lot of rows (products), we should have ideally implemented pagination but we have not.
We use JSF2 (Mojarra faces that comes with JBoss EAP 6.0). Main Page uses a different bean and Details page uses a different bean and both are in session scope.
When the user creates an offer, instead of refreshing the entire page (i.e. Page1), we just refresh the impacted cells using AJAX. However, the On double clicking the slot(offer), we redirect to a different page (Page2) that displays offer details.
Page 1 - Main Page and Page 2 - Details page.
There are 2 cases from here :
Case 1: User goes from Main page to the details page, just views information on the details page and clicks the close button. In this case, it is enough for me to display Main Page as it was before I opened the details page. To achieve this, we used browser history.back(). However, we faced the below issues :
(a) history.back() works only in Firefox and does not work in Chrome/IE.
(b) Even if we do history.back(), the page loading is cleary visible and as our page is heavy, it takes a few seconds. I would like to avoid re-rendering of main page again (i.e. make it look like opening a popup from the main page and closing it)
Case 2: User goes from Main Page to Details page and makes certain updates which require us to reflect those updates in the main page.(For example: change color of the slot from red to green on the main page).
Currently, when Details page is closed, we call an API that provides us with refreshed data (so that we do not need to maintain the list of actions that the user had performed) and we reload the entire Main page (Page1). However, as the page takes a long time to load, we are asked to refresh only the affected slots/rows.
So, the problem here is that if we have to achieve the refresh of Main Page through AJAX, we need to maintain a list of activities that has been done on the details page and feed it through AJAX which appears to be a complicated activity. (We also want to avoid calling the API.)
Is there any workaround which helps us to refresh only the selected rows on the Main Page to minimise the page load time. Can ui:repeat be partially re-rendered ?
PLease advise.

Magento EE banners rotation with full page caching on

A brief description of what I do:
- create 2 new test banners
- add a Banner Rotator to a cms page, either using the Insert Widget button or via a XML update in the Design tab, selecting the 2 test banners and rotating them as series, random or shuffle
- view the elected page in the browser, refresh
Only the first banner will be displayed.
If FPC is off instead, the banners will rotate as expected.
Is it a bug, or what am I doing wrong ?
The way full page cache works is that it utilizes placeholders for various data that is NOT supposed to be cached with the full page. Examples would include the mini cart, recently viewed products, etc. These separate items are cached and updated separately usually using a cache key that is made of a descriptive name plus the user's session ID.
This file: /app/code/core/Enterprise/PageCache/etc/cache.xml shows the placeholders.
A good example for what you need to do is here: /app/code/core/Enterprise/PageCache/Model/Container/Viewedproducts.php

Resources