Can a site template have both private and public pages in Liferay 7.x? - liferay

I have created a new site template, and I don't seem to be able to create public pages.
From the Page Tree I select "Public" and then click '+' and create the page. But the page ends up in the Private site.
When I go to Site Builder > Pages, I don't even see separate public and private pages.
I thought that I was able to do this before (in Liferay 6.x) but I don't have a 6.x server available anymore to test on. I can stand one up for curiosity, but that still wouldn't answer the need for this in the current version.
I need to create both pages from a template that will be used to create dozens - perhaps hundreds - of sites, and they need to inherit changes, so importing the public pages won't suffice.

Related

Users in Guest role see default theme instead custom one for given layouts

Users in Guest role see default theme instead custom one for pages which inherit from defined custom theme. This seems to be very strange problem.
Even though layouts have specified to inherit theme from parent theme:
Use the same look and feel of the Public Pages.
Guests see them as the one with regular Liferay theme. Any idea what can be causing such issue? Or anyone experienced similar problem?
I am almost sure this problem is related to layout revision functionality which we are using on our portal (or however is it called). From other hand, useful will be information about how Liferay is using these tables:
layout
layoutbranch
layoutfriendlyurl
layoutprototype
layoutrevision
layoutset
layoutsetbranch
layoutsetprototype
And how theme is inherited for layouts which defined option "Use the same look and feel of the Public Pages"? Where this information is stored for each layout, which tells him to use parent theme instead his own defined one? Where parent theme information is stored (the one defined in Public Pages first layout tree element)?
Thanks for any information, which helps me to understand this mechanism and maybe solve my problem.
Is this actually a difference between public and private pages?
Guests can only see public pages. Users can be on the private pages, and both of these can be set up completely differently.
Check the url in both cases and make sure they are actually the same.
After few hours consumed on analyzing our portal environment finally I managed to solve it. Here is the reason of such strange problem:
It turns out, the information about main parent theme (the one which can be inherited on child pages) is stored in different places for such options enabled on portal:
different for option : Page Versioning - > Enabled On Public Pages
different for option : Page Versioning - > Disabled On Public Pages
And after disabling such option it turns out main theme was set to default one, while with option enabled it was set to correct one.
Solution we used was to disable option of page versioning, change main parent theme for public sites, and then enable option of page versioning back again.
By the way, if you are awere of losing some important data configured on your versioned layouts, be sure to make backup before you start. I ended up with blank pages and had to restore it.

Adding pages and templates to a portlet

I am using eclipse ide and I have created a liferay project Test-portlet. I haven't written any code for this project
When I ran this project I got the usual welcome screen and I added the Test-portlet to the page and removed other stuff from the page.
I actually want to create a website using liferay. The website already exists which should be rewritten in liferay.
So when I load the project I get this welcome screen and the Test-portlet. At the top of this page I get the the menu-Admin,Sites,.... and LIferay logo on LHS.
I wish to remove all of these and displa only the web page data of the website. I know I can use themes and layouts for such purpose.
If I should use portlet to create this website , how should I keep adding pages and designs?
Also how should I add pages,themes,templates to this portlet?
Before creating this Test-portlet project, I had created pages using control panel.
How should I create this website? Using portlet by creating project?
EDIT:
Also this Test-portlet is displayed as a small portlet on the entire page. WHen click on the gear symbol and click on maximise, it only maximises during that time and when project is run again, it comes back to its original size.
Should I create this websiste using portlets?
Data for website comes from database. Few pages have static data.
Subsequent pages may be added in future.
HOw should the pages be added if I use portlet to create the website?
Please go through liferay themes and liferay layouts

New pages aren't being published to the right library (SharePoint 2010)

I created a new pages library, "News Pages", on one of my subsites.
Beforehand, I created some custom site columns, added those to a site content type, and then created a new page layout using those site columns. This page layout is used by default when a new page is created.
But when I create a new page, fill out the fields and publish, it's appearing in the subsite's default "Pages" library, NOT my "News Pages" library.
How would I go about changing my setup so that any new pages are published to "News Pages" library instead?
The SharePoint Publishing Infrastructure is built to handle only one Pages library per web site. This means that you will run into problems trying to add an extra library (believe me, I've tried ;))
The only way to have multiple pages libraries is to create a sub site and use it's pages library.

SharePoint 2007 Publishing site with deep menu structure

I am a beginner in SharePoint and I need to create publishing site that will have multilevel menu. Requirement is that levels will not be fixed and that client should be able to add pages and customize menu.
If I am not mistaken pages can be created only in the first level under the site. I don't see something like folders concept. For the navigation purposes I can add heading and it will be shown as another level. If I need more levels I need to create sub sites.
Site
Page1
Page2
Heading
Page3
Is this correct?
Site
Page1
Page2
Sublevel_1
Page1_1
Sublevel_2
Page2_1
Sublevel_3
Page3_1
...
Can I do something like this without creating SharePoint sub sites ?
If I don't need I will skip writing some custom menu control or write custom SiteMapProvider. I will than need to write UI for managing navigation also.
EDIT:
I have managed to create Folder in Pages list and create (actually move) pages to that folder and even create sub folder but they are not showing on the menu not even in the navigation settings page. I can't approve folder, it is in pending status what ever I try.
I looks like this is not possible by the Andrew Connell: Subfolders are not Supported in the Pages Library in MOSS Publishing Sites
Out of the box, you can modify the navigation for a Publishing site manually.
I assume that you are after a more automated way to do this. Unfortunately, the way to modify the navigation for a PublishingWeb is through the object model and the PublishingWeb.CurrentNavigationNodes object, which would require a timer job or some other method to update as pages are edited/added/deleted.
This is non-trivial and you will still need to create a solution/feature package.
The other way is to create a custom navigation provider.
The issue with both of these options (aside from the actual coding and release) is caching the navigation structure. We have used the standard web cache for the object holding the navigation structure, but using the standard user browsing (i.e. the menu code itself) to kick of a refresh of the navigation is fraught with threading issues.
You can create multiple document libraries in a site and then put the pages in the various libraries. That way you wouldn't need to create sub-sites

Running MasterPages from the Layouts directory

To simplify our SharePoint environment I am wanting to have a central and single location where all of the master pages are stored so I was hoping to reference the masterpage files directly from the _layouts directory.
I add the files to the "\LAYOUTS\MyMasterPages" directory and then update the SPWeb object to use that path:
web.MasterUrl = "/_layouts/MyMasterPages/newdefault.master"
But when I go to the site I get:
The referenced file
'/_layouts/MyMasterPages/newdefault.master'
is not allowed on this page. at
System.Web.UI.TemplateParser.ProcessError(String
message) at
System.Web.UI.BaseTemplateParser.GetReferencedType(VirtualPath
virtualPath, Boolean allowNoCompile)
at
System.Web.UI.PageParser.ProcessMainDirectiveAttribute(String
deviceName, String name, String value,
IDictionary parseData) at
System.Web.UI.TemplateParser.ProcessMainDirective(IDictionary
mainDirective)
I am assuming that this may be due to trust level security policies and a CAS configuration but I am not entirely sure. Is there a way to allow this central way of using master pages across the enterprise or am I stuck using the /_catalog/ virtual path?
This worked for me:
protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
this.MasterPageFile = "path to masterpage";
}
as proposed on:
How to use the site's masterpage from a _layout SharePoint page?
My understanding (but I don't know why) is that Master Pages need to be in the MasterPage gallery of each site collection.
Since you would need to deploy those packages to each SharePoint server (frontend, application, database, etc) in the farm, I think the requirement is either related to clustering, or perhaps to the database and ghosting.
In either case, be sure to use custom features as the way you deploy your master pages regardless of your farm size.
I understand the want to do things your own way with SharePoint, and while I am normally on board with that kind of thinking, the past year of pain has taught me that living inside of the recommended SharePoint boundaries is the best way to go.
The master page used by a SharePoint site must be located in the master page gallery. This is a hard requirement by SharePoint as far as I know.
This gives you more benefit than you might think. This allows you to change the master page in realtime using SharePoint designer with the changes only visible to you. Once the master page is check-in and published as a major version, the change becomes visible to the public. You also have version history on the master page.
I understand you pain, I have been in the same situation as you are. What I learned is: don't fight the platform, just work within it.

Resources