Display all categories from one site and only a specific category from another site in Expression Engine MSM - expressionengine

I'm using ExpressionEngine's multisite manager and I'm displaying channel entries from two of the sites - our global site and our localized site for our Australia office. For the Australia site I would like to display all channel entries, but from the Global Site channel entries I would like to only display channel entries from a particular category (in this case "25" ie. those tagged as pertaining to Australia on our Global site).
If I use something like this below, it wont show the any of the entries from the Australia site (tpi_au) because I don't have those categorize.
{exp:channel:entries channel="success" dynamic="no" site="tpi_hq|tpi_au" category="25"}
Is there a way to make that category="25" apply only to tpi_hq?
Sorry this is probably a really easy answer or I'm just doing something totally wrong to begin with... :/
Thank you!

I don't believe there is a way to do this directly in a single channel call.
Situations like this arise all the time, not just with MSM. What if you want 10 entries for category X and 7 entries from category Y? Same deal.
Basically you need to make two channel:entries calls.
If you don't care about the order of the entries you are done. If it bothers you that the tpi_hq entries are always at the top of the list while the tpi_au entry is always at the bottom then you need to figure a way to sort them.
Two approaches I've used for this:
Sort the entries on the client side. I've done this in jQuery using html5 data-date parameters on <li>s.
Muck around with passing forward the entry ID's as embed variables. This requires a total of 3 EE channel:entry tags plus an embed so it is definitely less efficient on the server side, if you are concerned about such things.
Incidentally, most of the EE questions are now handled in the EE SE. You might get a different/better answer over there.

Related

How to organize content in Orchard?

One of my colleague left on vacation and left me with an Orchard project to work on.
I never worked with Orchard, so please excuse my ignorance and my possibly stupid questions.
I come to you for general advice on how to implement and structure the content of my site, as my research didn't give me the answers I'm looking for.
Here are the requirements:
The site must be divided into sections (section A, section A-1, section A-2, section B, etc...)
The navigation of the site must be based on the sections, each navigation item must also contain an image
Each section has a separate page with roughly 4 types of content that must be displayed:
Title of the page
Articles associated with this section, which represent the main content
FAQ content associated with the section which should be displayed in a specific zone
Miscellaneous content associated with the section which should also be displayed in a specific zone
I'm struggling at nearly every aspect of the requirements...
We started building a taxonomy, with as many terms as we have sections, allowing us to build the hierarchy we want, which is perfect. But this had 2 downsides:
The built-in taxonomy-based navigation is static, so the only thing displayed is the term, and we couldn't find a way to change it so the user would be able to add an image to the taxonomy term.
The generated pages based on the taxonomy display every content item based on the current term, that is, the articles, but also the FAQ content and the miscellaneous content, all in the Content zone.
Is there any way to work around these issues by using the built-in taxonomy? Or will I have to build content types from scratch in order to achieve what I'm trying?
The solution my colleague came up with was to add a layer for each section, and add in this layer 3 widgets, one for each specific content (title, FAQ, misc) in different zones. But I don't think this will me maintainable, as we currently have 4 main sections, each with 4-5 subsections, so that's rougly 60 layers, which will be a nightmare for the client to maintain.
Any advice will be greatly appreciated, I'm kind of lost.
Thanks in advance,
Mickaël
Taxonomies was a good start, but now you need to study projections. You'll be able to set-up filters about what you display.
For adding an image to your terms, one way to do it is to add a media library picker field to the type that was created for your taxonomy.

How to use PageLayout in a SharePoint Site?

I am kind of new to SharePoint. I am learning it on the go and learned about the concept of pagelayout and publishing features on the site. But I am not really 100% sure what is the difference between a WebPartPage, SitePage and PublishingPage. I kind of know what all these pages be used for, but what I not get is: why do they need to separate all these pages?
I think we can just get a publishing page and have all the feature there including webpart and everything else (with our choice of PageLayout). However I dont see a way to use a pagelayout on a particular SitePage.
Is there any particular reasons for using either one of them? Even though it seems like one of them can serve as all of them?
You should use page layout when ever you know the page structure. For example you are running an online news paper. You want to show the news to the users into three columns. First column is for menu, second column is for news content and third column is for advertisements. Now in your daily usage this layout is common. So you can use this page layout for entering the news. After creating the page layout you can make it as a default to your pages. Page layout is nothing but the structure of a page simply!!
A webpart page does not have a field for content directly on the page like a SitePage has. A Publishing Page is like a SitePage, but requires extra fields for dealing with the publishing extra features.
Using a single layout for all three risks being confused as to why one page does not work the same as another when it has the same layout (the difference would be the underlying features are different.).
I will make a comparison with cars. There are three type of cars, each is better suitable for a certain purpose: tractors for farming, buses for public transport, light cars for private transport. You could use a tractor for all the purposes above but it's not ideal.
"One of them can serve as all of them". This is not true in their current implementation. I'll give you one example: prefer Web part pages against Publishing pages to better control content added by contributors in an intranet. There are many other examples.

can an opengraph object be multi-page?

I've searched a lot for the answer to this question - but can't find one - possibly it is just too stupid, in which case please forgive me!
I want to add og metadata to our pages, but the information for each logical object (in our case a sports team or player) can be spread across multiple actual URLs (eg /team/, /team/players/, /team/results/ are all logically part of /team/).
Can I put the same opengraph metadata on multiple pages that represent the same object?
Or alternatively, can I specify the og:url as a regex, eg: /team/* ?
Or does /team/ imply /team/* for an og:url ?
Thanks very much for any clarification, Mike
the information for each logical object (in our case a sports team or player) can be spread across multiple actual URLs (eg /team/, /team/players/, /team/results/ are all logically part of /team/).
Do you mean all of these URLs contain the same information (they are just different points of access to that info) – or do you mean the info is spread in „bits and pieces” over these URLs (and a user would have to visit them all to get all the info)?
I’m not sure I understand your question/problem here – but maybe you’re just looking for what’s called a canonical URL …?
You could call in every subpage the Open Graph API passing the parent page as object; no need to put metadata also on subpages, if you are not interested in having subpages as separate objects. This way, a like clicked on an individual page is always given to the team. You might use a custom property to specify from where the click arrived (or even the ref property, maybe).
On a side note, I would not tell that results are logically part_of the team. Although for this specific usage, it does not matter.

Simple expressionengine category filter

Despite working on EE for about 3 weeks now, believe it or not, this is the first time I've tried to use categories. I basically have an events channel with categories of hotel, restaurant, golf etc. On the events index page sidebar, I'd like to display the categories which when I click reloads the page with only the entries with that particular category.
From reading a few pieces here and there it seems that with path="events/category/{category_url_title}" it should work.
The URL when clicked does look right to me ie: events/category/hotel and the page does reload, but all the events show, even the ones without that category.
Am I missing something silly here? Should the channel categories tag be wrapped in a channel entries tag?
Would appreciate any help you could give. Thanks!
ANSWERED:
Answering my own question here. First off, I hadn't specified the statuses in my channel tag pair (how often is that the problem?!) After that, when I tried with just path="events/category" it worked fine and then I read that there was a setting that had to be turned on in channel global preferences to be able to use the category url title.
So now all is well again!
Answering my own question here. First off, I hadn't specified the statuses in my channel tag pair (how often is that the problem?!) After that, when I tried with just path="events/category" it worked fine and then I read that there was a setting that had to be turned on in channel global preferences to be able to use the category url title.
So now all is well again!
You can sort your problem out the easy way. Head on to:
GW Categories
and IT IS FREE! I used it and I love it.
Best Regards.

Problem with categories and structure module - Expressionengine

I’m currently working on a travel site for a client of mine, they require a cms so that they can add hotels and destinations and also update their website with ease.
The basic structure of the site is explained below:
1. Home page
This page currently pulls out destination information and a section of hotels that change on the refresh of the page.
2. Destination listing page one
This page will show the countries in this specific destination so for example: if the destination is the Caribbean it’ll list out the countries that my client sells hotels for, sorted by rating so if a hotel is rated 5 stars it’ll appear near the top of the listings. The countries are setup as categories and are unique to the listing pages, the categories contain a brief description of that country and an image that will link to the hotel list page displaying the hotels in that country.
2b. Hotel list
This page will contain the list of hotels that are on sale in the specific country.
2c. Hotel description page
This page contains pictures and information about the selected hotel.
3. Destination listing page two
3b. Hotel list
3c. Hotel description page
This section has the same concept as the first destination listing section above except the information is unique to its destination. (obviously)
So first things first, I’m having a few issues with how the functionality of the cms works, at the moment to add a hotel my client has to fill out one big form (they like this because it means they don’t have to move around the cms too much). I’ve created two weblogs for each destination but the fields are the same.
In order to add a hotel to a specific country you have to assign it using categories. Now the problem I’m having here is that if I want to make a hotel appear in more than one country it displays both country names, images and descriptions and I can’t figure out what the hell is going on, I thought of using some sort of tagging system because I thought this might be more appropriate to what I need to do?
Secondly I’ve downloaded and installed the structure module as I thought this would be good to help my client visually see how the site is structured (excuse the pun) and make adding hotels and other pages and content even easier than it already is and not only that but to have an automatically updated menu and sitemap. I’ve read through the documentation and I’ve tried experimenting with a few of its features - such as the listings feature. I thought this maybe a better way to list and organize my countries instead of using categories or tags but would this work or would it make things so much harder to maintain and keep track of? Because currently if my client wants to edit a certain hotel they just select it from the edit menu and change all of the information in that one post, would by using the structure method make it more awkward?
I from what I can see, the structure module works by treating weblog posts as ‘pages’ now with this in mind if I wanted to use structure how would I get it to work in the way that I want it to, in terms of having a weblog with one big field group so that when a hotel is added all of its information is in one place instead of being spread across 3 different weblogs?
RIGHT, I hope I’ve not confused you here.. If you need any more information just holla at me!
Thanks
Make a weblog for the hotels, then use the Playa module to relate the hotels to the Structure pages. (I know this answer is a bit late, the site is probably long finished...)

Resources