Liferay 7: Is it possible to get an image for from a linked site to a sitemap automatically? - freemarker

Liferay 7.3.2.
I'm using a sitemap to create link boxes that link to other pages in the website. Links and names and all else is basic stuff, but I have no idea, if and how I could get images for the boxes.
Asset publisher would've been my first choice, as I've done similar stuff before with them, but I can't find a way to add pages to the publisher, so I'm not sure if it's viable here. Of course, I could create an asset publisher that would ask for a name, image and a link, but this should be automatic to avoid extra hassle.
Sitemap allows for automation, if you just map the page correctly, but getting the image would still be a problem.
Navigation menu I haven't really put much thought into, as there will be many pages with link boxes and would be really hard to control. The image would be a problem as well.
The optimal solution would be to get the image from the page the link takes the user to, but if that's impossible, I wonder if there's a way to give webpage an image, that could be shown here.

Got it working with a bit of looking around! This can help with same kind of problems others might be facing, so I'll gladly answer this myself!
From Admin panel, go to Settings and Additional Fields
Select Page and add a field to it. After filling the details, you should be able to see this field in the page settings for every page.
Go to page settings and fill out your info. In my case, I created a text field, that will be used for image URLs.
Finally, in your Application Display Template, you can find the field by writing:
${entry.getExpandoBridge().getAttribute("Extra field")}, Extra Field being the name of your field. Remember to put conditional statements, if necessary!

Related

How to add RichText editor to a page as component in HippoCMS?

I'm creating some project using HippoCMS 10 and I need to add RichText editor as part of the page, so that customer can use it and fill something there. This editor must act exactly the same way as in Document Editor (customer can click Image button in toolbar and select image from ImagePicker dialog box).
Can't find anything about it in HippoCMS official documentation. I learned how to create custom plugins and how to integrate CKEditor into page separately, but for image picking, I need default behaviour as in Hippo.
How can I achieve this? Any help will be appreciated!
I think your question was answered on the community group. The answer there was:
"it should be quite easy to have a CKEditor in the website.
However, it doesn't really make sense to me to have site visitors able to pick CMS documents and images from the site. The picker dialogs are designed to work inside the CMS only. You should be able to create your own picker dialog that can read from a REST service that exposes the images/documents.
I don't think it will be possible to reuse the CMS picker dialog in the site."
and
"your use case is fine, when I said "it doesn't really make sense", I was really referring to the technical limitations of the pickers. You should be able to achieve what you want with a custom dialog that plugs into a REST service though. Unfortunately there is no quick solution for this that I can think of."
Just adding this for future reference.

Joomla - Modifying default category list view (through overrides?)

I'm building a site for a friend and I should state that this is not what I'm doing for living. I just started working with Joomla a few days ago.
Everything is good so far, except I'm stuck at one point.
This is a site for a construction company and I need to create articles for on-going and completed projects. I will create an article for each project and each article will belong to a category, 'Completed' and 'On-Going', respectfully.
I plan to create menu links for 'Completed' and 'On-Going' categories in main menu. I also want to present a thumbnail of the article on the category list. Problem is, standard look of the category list is kinda ugly, and I have no idea how to change it. I'm using a template named PixelDot, but it does not seem to do any good for my problem.
During my research, I stumbled upon concepts 'Layout Overrides' and 'Alternative Layouts'. I have basic html and css knowledge, also some PHP, but I am totally lost on which file(s) to modify. I also need a little help on get the entry text picture as a thumbnail on the category list (this is the list where you see 'articles' aka projects which belongs to the category (completed or on-going), when you clicked on relevant menu button)
Any help will be highly appreciated. My Joomla version is 3.4.1. (which I believe most up-to-date version as today)
I'm sometimes making it more complex while I try to make things detailed and clear, I hope this is not one of those cases.
First, I would suggest using tags rather than categories to manage this. Tags are much better suited for temporary labelling or dividing into groups.
Second, go to the template manager, template view for your template.
Go to the create over ride tab and select the view that you want to override (i.e. tagged items).
This will automatically copy all the files to the correct location in your template.
At that point you can play around with the layouts to your heart's content.
Also ... some pieces of the layout you may want to override may not be in the traditional layout but may be in a jlayout. You can do the same thing with them. THis is all documented in the docs.joomla.org site as well as around the web.
I also would do this with Tags. One reason is, assuming you are using SEF URLS, that the projects article pages will have a unique URL. If you move a project's article from "on-going" to "completed" then you may be changing that SEF url. This will cause your search engine ranking for that page to be lost.
I would tag each article "on-going", "completed", etc and then create a menu item to display only that specific tag. The project's article would stay in its original category, that could be my project type, project location, etc; which also will increase the SEO for that given project's article.

Custom data in pyro cms pages, such as images or other data

I'm wondering how in PyroCMS I can add a custom field to a page. Ideally I would like to have an image area at the top of the layout, and have a custom field in pyro that would allow someone to populate that image from the pages module. I realize that there are some image plugins that allow me to attach images to pages, but I would like to be able to add the images directly into the page in the admin (as well as other custom fields for the pages). Even on a separate tab would be fine with me. I'm fine building something if someone can point me in the right direction.
Currently if you want to add a custom field to a page you have to hack the module. This is obviously not ideal and im not really suggesting it, but I had to do it for http://tedco.org/business to add a "Subtitle" field to each page.
2.2/develop is having its Pages and Blogs moved over to Streams, so you can add custom fields to all pages globally, meaning you can add an image in if you like, or append a US State for some reason, or add a slider. Whipee!
So right now: Hack it or wait. 2.2/develop will have your feature in a week or two.
I'm not sure you can do this directly from the pages module yet or not without some customization (possible hacking) though, I just asked and will update if possible.
In the meantime this might be helpful:
Consider looking into PyroStreams. for this though, it will require the Pro version of PyroCMS or you can purchase it from Parse19 directly.
You might find this article helpful about organization and page layouts.
Here is an article called Dynamic Pages with PyroCMS and PyroStreams though, it's a bit outdated now.
You may also make use of the gallery module, which is free though, I'm not sure this will meet your needs.

display custom attributes on Virtuemart browse page

I need the browse page to show quantity box, custom attributes, and Add to Cart button all together.
It doesn't show it at all. Only when you go to the product page, you can see them.
Any solutions?
Thanks, Ahmed.
Ahmed, you'll have to modify the template directly to do something like that. VM uses a large number of template files written in PHP. If you're using the default template, you can find them here:
components/com_virtuemart/themes/default/templates/
From there, it takes a little looking around to figure out exactly which template you need to edit. If you need to edit a browse template, my recommendation is go to your VirtueMart Administration in Joomla backend and look at Admin | Configuration | Site | Layout to get an idea of which files you're using. It will probably say "Default" in the dropdown, with a Configuration link directly below. Click that link and look at the very first item, Product List Style. From the description of your layout desires, you might be using Flat Product List.
The main file for editing that layout is:
components/com_virtuemart/themes/default/templates/browse/includes/browse_listtable.tpl.php
If you're a programmer, you should be able to look thru the code and correctly guess which code elements are being used to display VM product details. If you're not a programmer, you can still fake it by commenting out sections to see what "goes away" on the actual product page. Use what you learn to strip out useful code and move it around.
Another useful file to pull VM product code from is:
components/com_virtuemart/themes/default/templates/product_details/flypage.tpl.php
This is the actual product view (unless it's been changed in VM config), and contains pretty much all the common code elements that extract product details. You should be able to lift some of that code and place it where it needs to go in other forms.
Good luck with all of this. I find VM coding painful, and community support in the VM forums can be... sparse...

Sharepoint 2010 - create page with cropping image field

I'm using Sharepoint 2010 (as a beginner). I need to find the best way to allow a user to create a new page inside a sharepoint site. The page must have an image field which the user can crop when he creates the page.
I have 3 problems concerning this:
How can I allow my user to create the page in a single step. The default behaviour is: create page with Title, Url and Content type and the edit the page layout or the page properties. Is there a way to do this in a single step?
What view should my user use when editing the page? The "Edit page" view, or the "Edit properties"? I don't like the "Edit page" view because... it doesn't look like the right way to do it... BUT, I like the fact that I can use my custom BaseFieldControls in this view. The "Edit properties" look great, BUT, customizing it looks like a nightmare. And, of course, I cannot ask the user to use both views...
One of my requests is to allow the user to upload a sharepoint image for the page, and then to crop tree different sizes using the base image. The big question is: where should I allow my user to do this?
In a webpart inside the "Edit properties" window? - Not very easy to integrate it. It seems almost impossible.
In a custom BaseFieldControl in the "Edit page"? Would be great, but, I don't want the user to use this view.
Create my own Asses Picker aspx page for the "Upload image" field, and replace the default one - _layouts/AssetImagePicker.aspx? Is this even possible?
I dont have an answer for everything but for number 1, maybe:
Check out SPServices. It is a Jquery project which is designed to help people use Jquery on Sharepoint sites. It is really useful for accessing, editing, and writing data is less lines of code than ever before... Unless you are a genius and have SP figured out which most do not.
To be honest, the only way to do things in "1 step" is with javascript anyway...
Hopefully you have heard of Jquery:

Resources