Add an ImageGallery under Article - image-gallery

I have for same Article a ImageGallery. How can I add the gallery to an article by Schmea.org?
What is the best property to declare a gallery to an article?
Gallery is "Thing > CreativeWork > WebPage > CollectionPage > ImageGallery".
Is the property hasPart (CreativeWork) the best one?

The ImageGallery type is for image gallery pages (as it inherits from WebPage), not for any kind of image gallery.
So ImageGallery doesn’t seem to be a suitable type for image galleries that are part of an Article.
There doesn’t seem to be a good alternative to model these for Article. A simple way is to use the hasPart property for each ImageObject, but this doesn’t allow you to state something about the whole gallery.

Related

How to display all images from a blog article

I am trying to display all the images from a blog article in the blog listing page.
Currently it only displays the image marked as preview in the shopware backend > blog article configuration > Image configuration. But I also need to display the others if you select more than one.
I have been trying to modify the box.tpl file from the blog folder, the detail.tpl, and even the Blog.php file under Shopware > Controllers > Frontend but didn't have luck.
In the Blog.php file under the index method I saw this piece of code but not sure if this one does the trick
//adding thumbnails to the blog article
if (empty($blogArticle['media'][0]['mediaId'])) {
continue;
}
$mediaId = $blogArticle['media'][0]['mediaId'];
if (!isset($medias[$mediaId])) {
continue;
}
I am not a shopware expert so any tip would be appreciated.
Thanks.
You would need to write your own plugin and override the index method of the Blog Controller.
You can take a look at the Blog Controller's detailAction how to get all media images.
In your above example you're just getting the first image with [0], but you would need to loop trough all images like in the detailAction.
You may also have a look at the Shopware developer video trainings on Udemy and the Shopware developer documentation.

How to change orchard blog home page list view/summary view

I have Orchard 1.7 setup with blog recipe.
The home screen display a list of blog posts.
I want to override the way the content is displayed in summary view. I could do this for each parts. But my styling is such that I need to wrap title, body, and meta tags with a special div when ever the display type is summary.
The problem is:
After shape tracing I understood that the template used in the home page (summary) is same as the detailed one.
Content.cshtml
For detail view I want to use the default core-> Views/Content.cshtml but for summary I need to supply my own. How can I do this?
OR
How to write a driver/widget to the home page. I know how I can do this for parts/fields/modules but I don't have an idea on how to create a driver for Blog home page.
Whenever I add a widget to the homepage the default blog post list still get displayed.
Just create a file called Content.Summary.cshtml in your theme. This will target all summary views, so if you have more than just blog posts on your site you will probably want to have Content-BlogPost.Summary.cshtml.
I wrote a small blog post on Item templates in Orchard if you are interested... http://arkleseizure.net/what-the-hell-is-an-item-template

Orchard Projection Isotope

I'm trying create an affiliate directory on my Orchard site. The directory is populated by running a query on my custom Content Type. The directory needs to be sortable and searchable. I've set up a basic jsfiddle here that is a basic functioning version of what I'm attempting to do, but it's just in html: http://orchard1.pha.jhu.edu/affiliates-beta-2
Or you can view the jsfiddle here: http://jsfiddle.net/tgelles/AMZf8/
Has anyone discovered a way to best use isotope on an Orchard Projection? I've downloaded the Projection Layout module, but I have no idea how to use that/where to inject the specific isotope code. I've also created alternate template files for the Projection's Summary display, but I don't know how to best inject the isotope plugin into that razor file.
Any help would be appreciated.
The best way would be creating a shape, but You could easily edit the query template and inject the js through a custom view for that projection(url,type, etc)
Check in your Queries.
There was a video which helped me understand better how they work: http://www.youtube.com/watch?v=Ka55wTTXZg8
Hope it helps.

Orchard CMS create theme view for my content type

I am using orchard cms with the bootstrap theme.
I have created a content type: House
it contains FIELDS
image (media picker field)
Property Type (taxonomy field)
Location (taxonomy field)
It has PARTS
common
body
publish later
Title
Autoroute
I want queries of houses and be able to choose the view/ layout for them
e.g. layout called HouseList (for sidebars mainly) which will render: title, image and link to house, possible location and type but with out the links as defaulted. And then a fullDetails layout and a image only layout (so i can show a jquery image reel a widget say in a quadzone) How can i do all this please, i have tried in view Content-House.cshtml etc but i cant access the details model.content to choose what to display.
Im sure when i get the idea of how to do 1 i should be able to sort the rest. I have read documentation etc but there are so many different ways, ie placement file, change the parts, contents, create classes to handle display etc. sureley i am missing something simple like create a view for each list i want eg. houue-list, house-details, house-imageONly and then manipulate content.
Please help i have been trying different things for getting this site running for weeks and not getting very far. Examples would be fantastic but i have searched google for hours and found similar but nothing with enough details for a meer beginer.
Thanks
The standard way of doing that is placement to move things around and alternate templates for the different parts and fields. You can specialize placement and alternates with the display type, which is Summary when rendering in a list such as what a projection returns, and Detail for the detail view. More info on placement can be found here: http://docs.orchardproject.net/Documentation/Understanding-placement-info and on alternates here: http://docs.orchardproject.net/Documentation/Alternates
Now if you prefer to completely take over the rendering and do without placement, here are a few posts that may help:
http://weblogs.asp.net/bleroy/archive/2011/07/31/so-you-don-t-want-to-use-placement-info.aspx
http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx

How can I specify a background image for a content query Webpart in SharePoint 2010?

How can I style the background of a content query webpart in SharePoint 2010?
I have been having a look around, and can't seem to figure it out. I am able to edit the individual item styles using the ItemStyle.xsl file in SharePoint designer, but I need a background image on the container.
I have referenced the class that is generated by SharePoint - 'WebPartWPQ4' - in CSS, and made it work that way, but that changes the styles for all web parts in the system. (This also feels like a bit of a hack)
Any help would be greatly appreciated.
It is totally okay that you try to override custom styles in your css (although 'WebPartWPQ4' is not the best choice). However, to get what you need, just ensure that the web part you want to style has some wrapper around it and change selector in your css to .wrapper > .WebPartWPQ4 so that only this instance of the web part gets styled.
The way I have solved this is to wrap the webpart zone in a div in the .aspx page file.
You can then reference this div in a css file.

Resources