Create new page in magnolia cms from Blossom module - magnolia

Could anybody please tell if it is possible using blossom to create new page in Pages and fill it with particular components(and configure components by putting there some variables) ? I would like to do it in the java code.
Best Regards
Jan

Whether with blossom or not, if you can define template with automatically created components so as soon as this template is assigned to a page and page is opened, all auto-created components and areas will be created.
HTH,
Jan

Related

Xamarin Templates -IOS

I am currently learning app-building basics with Xamarin. My question is what is the difference between "Blank-App (iPhone)" and "Master-Detail App (iPhone)".
Thanks for taking the time to answer my question.
These are two different templates for you to choose.
Blank-App (iPhone) means you just create an empty project without storyboard, RootViewController or other extensions. You can customize it whatever you want. If you are new to Xamarin.iOS and unsure about what template to use, try to use Single View Application.
Master-Detail App (iPhone) means when you choose this template. System will automatically create a UISplitViewController with a default Detail and Master for you. So there's no need to configure the rootView. It's a type of showing the ViewController.
You can try to create these two template projects then run to see the difference between them.

Composite C1 - Page template - Media folder placeholder

Just downloaded Composite C1 one week ago, and started to learning functionality of this IMHO really good piece of software.
I have done a setup of Open Cph site, and started to building a web site.
Successfully integrated Composite with Visual Studio 2013, I am referencing issues to specify a media folder for Bootstrap carousel via page design mode.
This is what I did for getting this feature done :
Make a custom page template -> Called DestinationPage, where I have a
#Function("Composite.Media.BootstrapCarousel" , new { ImagesFolder = this.ImagesFolder})
Unfortunately, this whole morning I am trying to figure out how to pass this.ImageFolder value
from LayoutPage to DestinationPage with PlaceHolders. Is there any possibility when editing
a page to have a placeholder where you can pickup or choose a media folder?
I want to specify for each page a different media folder where BootstrapCarousel will
pick up images.
Anybody have solution for this?
I have several ideas on my mind, but as I said I am not experienced with Composite....
Thanks in advance.
Have you tried looking at creating a Page Metadatatype which will show up on a new Metadata tab when editing a page.
These are two good articles about Page metadata
Adding Metadata Fields
Filtering datatypes with metadata

Alfresco Share | Using dashlet into a custom page programmatically

I'm very new to Alfresco. My question is, how can we use a dashlet (created from scratch) into a page (created from scratch too)? What are the files and configurations to deal with, for including a dashlet into a page.
Moreover, the newly created page has to be similar to dashboard page but without authentication. The idea here is to do away from the default "Share" dashboard login flow.
Thanks.
A dashlet is simply a special type of web script, so yes, it is quite possible to place the same web script into a custom page by binding it into a component region.
The relationship between pages, templates, components and regions can be a little complex if you're new to Share development, so I'd recommend reviewing Dave Draper and Erik Winlof's Share Customizations Live presentation from last November's DevCon, where they introduce a sample project including an Ant build script and which includes a custom web script and page definition. The code can be downloaded from this Git repo as a basis for your own project.
You should not find that too many changes if any are required to your dashlet web script to make it work inside a custom page, but remember that if the user is unauthenticated then you will not have access to any information about them, nor will you be able to retrieve any data from the repository.
Let me try to answer this with some examples:
Alfresco page
To create an Alfresco Share page (you use share?), you need to create three files:
<TOMCAT>/webapps/share/WEB-INF/classes/alfresco/site-data/pages/my-page.xml
<TOMCAT>/webapps/share/WEB-INF/classes/alfresco/site-data/template-instances/my-page.xml
<TOMCAT>/webapps/share/WEB-INF/classes/alfresco/templates/org/alfresco/my-page.ftl
The first one defines your page, the second one defines what components (dashlets) you will use on the page, and the last one is a HTML template (in Freemarker) arranging your components.
The first two files are XML, a bit alfresco specific, but simple XML, and the last one you could put static HTML and it'd work, or you could put some freemarker macros.
What is in each of those files (examples), you can read on this page, written specially for you and this question :) (Don't ask, I felt like writing about it)
No authentication
To not use authentication, you can just put <authentication>none</authentication> in the page definition file (the first XML file).
Dashlet files
Basically, a dashlet can be at the minimum two files, usually 4-5 or something like that. The dashlet.get.desc.xml file signifies two things: desc.xml part says it's for a new component (dashlet), and get part says this component will answer to HTTP GET calls.
is usually placed somewhere bellow /webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components. Doesn't really matter where bellow, but you would want to put it in some folder to manage all your code easier.
This file contains one important thing: url. Url defines what url your dashlet will answer to. And when you defined your page in the page definition above, you would put this url there to access the dashlet.
You could even access the dashlet directly, using the link http://localhost:8080/share/my/url/to/dashlet.
The other file, dashlet.get.html.ftl is, again, a freemarker template file. You put HTML there. You can also have a controller file for the dashlet, dashlet.get.js which prepares some dynamic content (it is written in server-side javascript and has access to some of Alfresco Javascript API).
Finally, you can put some internationalized text (translations) into bundles (basically, dashlet.get.properties, dashlet.get_DE.properties, dashlet.get_ES.properties etc, by browser lanugages).
There are also options to include client-side javascript or css files to this dashlet.
To see how exactly to assemble all this, you could try reading this page. Probably not really a good read, but it will hopefully clear some things up.
Sorry, just to be clear, you want to reproduce a share interface on an Alfresco repository, but without the login? Dashlets and interface components are webscripts, and webscripts are stored inside the repository, so in order to access them you need to be authenticated. You could use tag in the webscript xml description a runas="admin" or runas="guest" in order to achieve something. If i misunderstood, please let me know, and I'll try to help..

Require at most one instance of component on a page

I develop the site with Day CQ5. I am developing templates, components, and pages and faced with a problem. On the page of the site can be one instance of component, and need to prevent the addition of other instances. How can I do this? Maybe someone has faced this problem?
If the authors don't need the ability to add the component to different areas (parsys containers) of the page, you could just include it in a static location. Authors could then either populate the component or leave it blank to hide it. Then you would leave it out of the sidekick so they couldn't add additional copies.
This is just a hint, but it might solve your problem: http://dev.day.com/content/kb/home/cq5/Development/Components/HowToDefineComponentListDynamically.html.

How to implement a node-VIEWNAME.tpl.php with Drupal Views module?

I am working with Drupal and Views module.
I am using the same theme with different Views.
I have created different pages which are listing nodes per viewname as this : views-view-fields--VIEWNAME--page.tpl.php but now when I click on an article title, I would like to personalize the node with the viewname, so I would like to use node-VIEWNAME.tpl.php, but it's not possible. The only thing I can do, is to create a node-TYPE.tpl.php but I do not want to follow this way.
So my question is how can I implement (may be with a hook function?) the node-VIEWNAME.tpl.php when I click on an article title (so when I have only one full article and which is defined by it's id in the url. This is for precision, I am not fluent in English.
Thank you very much !
Alexandre
The correct way to do what you're attempting - use the Display Suite module, set the view to point to a Display Suite object in the field settings, then click the gear next to that setting and pick the build mode you want to use. Then in your template.php file, do whatever special work you need to do to that build mode.

Resources