Showing logged in user as the author in Hippo CMS - hippocms

I have configured Hippo CMS and I am using content (simpleDocument i guess) to show content on my site. I want to get the logged in user as the content author and show it in the website with the content. Currently I am using content blocks and added a text field (author) and i am accessing it with ${document.author?html} and I saw in cms console that there is a property named createdBy in this path /hippo:namespaces/hippostdpubwf/document/hipposysedit:nodetype/hipposysedit:nodetype/CreatedByI want to know how to access this property through freemarker.
Thanks !

you can do this by creating a method in your bean and use getProperty("hippostdpubwf:createdBy")
hth!

Related

How can I add a custom page to Shopify without the /pages/ URL?

I want domain.com/custompage, but the built in functionality puts all pages inside a /pages/ directory so the URL comes out domain.com/pages/custompage which I don't want.
I found this answer from a Shopify Guru in 2016 that mentions potentially setting up a custom HTML template or using an app, which no longer exists.
Any clues on how to achieve this? I have limited experience with Shopify templates, but could figure it out if someone could point me in the right direction.
This blogger says it can't be done:
"Q: Can you create pages on the root? A: The answer to this is no –> all pages have either /pages/, /collections/ or /products/ in the URL."
However others have told me it is possible. Just not how to do it.
Create a section Name "test" // first a step
Create a page json Name "test" // The second step
After creating the page, JSON does a section test

B2C Hide the Social Intro

I updated our version of self asserted to 2.1.2 to address the new password reset flow. Doing this has added the social_intro to our custom log in page.
I have added the local_intro_generic to the page and it works fine, However the social_intro still show up. We are not allowing for any social login and I don't want it displayed. I can edit it... but I don't see a way to hide it either in the documents or any other search.
You can edit the html file that is getting referenced for that page. Hide the divs that you don't need after checking the class names of the divs using inspect element.

How to get public access to files or images from Podio API if I have image ID or File Object

I have created an app on Podio. Items are attached to that particular app. In the items there is an option to upload an image. Now I am authenticated with the App ID and App Token from Podio PHP API. I get the file object and grab the thumbnail link. The thumbnail link is working on the browser where I am already logged into to Podio. But it does not working on private window. It redirects me to login page.
So my question is how could I get public access to the thumbnail link?
Short answer: you cannot.
Long answer: when Podio hosts a file, it checks if you're authorized to view it. So if you're logged in and viewing the url through your browser, it will show, otherwise not.
You would need to copy the image to a publicly accessible location. For example, on your web server:
$file = PodioFile::get($file_id);
$raw = $file->get_raw();
file_put_contents("/var/www/html/image_path/".$file->name, $raw);
Then you could view the file:
http://my_domain.com/image_path/image_name.png
You can get a "public url" for a file stored in image field using Globiflow (it is now available with a premium plan). I guess it adds some kind of a proxy layer for private files. So you may add a special field to store this public URL, set/update this field value with Globiflow workflow and use this URL for public pages.
Have not found public documentation for this, but the value "Public URL" is currently available for image fields, I've specially checked.

Auto configure page SEO of a module front controller on Prestashop

I added a ArtistsArtistsModuleFrontController on my artists module.
It's working perfectly but I add to go on the back office, section SEO & URL and edit module-artists-artists page to set Titles and URL (for each translations).
This is quite overkill and I would like my module to configure it automatically on installation.
Is this possible? How?
If you doesn't want to use database method, you can set directly meta title, meta description and meta keywords in your controller by set $this->context->smarty->tpl_vars['meta_title']->value
For custom url, you must use hookModuleRoutes : http://blog.belvg.com/how-to-generate-a-custom-url-in-prestashop.html

Piranha CMS customisation

A few questions on customisation with Piranha CMS.
Is there a way to create additional custom site-wide items similar to those from the site helper? http://piranhacms.org/docs/api-reference/site-helper
e.g. to be able to set a phone number used throughout the site but still editable in the settings section of the manager.
Is is possible to create additional custom items for a page, e.g. page subtitle, and for those to appear in the Information section of page editing? Creating a region for say a page subtitle seems overkill.
Is it possible to create a custom page type with a region that is a collection of HtmlRegions or similar? e.g. for the purpose of managing a set of FAQs or similar enumerated content?
Is is possible to define custom settings properties for a page type?
Yes, you can add regions to your site in the same way as with page types under Settings > Sites. You then add content for them under Content > Pages > Edit Site.
You can add simple text properties on the page type. They will be shown as single line text inputs under Properties when editing the page.
No native support, however the region body can be anything that can be serialized to JSON so you have to handle this in the edit view for your region.
There is no support for injecting fields into the page settings, however if it's important you can override the whole edit view for pages and do anything you like by placing a copy of the view in the manager area in your local project. You can find the views in the github repo in the 2.2.5 branch.
Regards
Håkan