Making an addon both Plone 4 and Plone 5 compatible - plone

I'm trying to make an addon both Plone 4 and Plone 5 compatible. The problem I'm running into is the profiles/default XML.
Plone 5: I have a registry.xml for registering CSS
Plone 4: I have a cssregistry.xml for registering CSS
I was hoping Plone 4 would ignore the registry.xml but it picked it up and then crashes during the install in Plone 4. Is there a solution to this?

You can have multiple profiles pointing to different profile directories (they are defined in configure.zcml), and the Plone docs have examples of how to conditionally evaluate ZCML:
<include zcml:condition="have plone-4" package=".package" />
<include zcml:condition="not-have plone-4" package=".otherpackage" />
There's also a straight "evaluate content if condition is met" by having zcml:condition on a configure.

What you said works great when you add:
xmlns:zcml="http://namespaces.zope.org/zcml"
To the top configuration. Just a note for any future people who need this.

Related

Does Plone 4.1 use KSS? Can I disabled JS and CSS files associated with KSS safely?

Does Plone 4.1 use KSS? Can I disable JS and CSS files associated with KSS safely?
I see this in the documentation:
http://docs.plone.org/develop/addons/javascript.html?highlight=kss#id27
but my Plone 4.1 site still loads files as ploneKss.css, at.kss, plone.kss, etc. Is the plone site still functional (working) without these files?
You can disable them. You'll lose some progressive enhancement features (ability to drag files to reorder on the Contents tab, for example), but the site should still be usable.
Or you can upgrade to Plone 4.3, which no longer uses KSS.

Plone-Theme navtree.css unknown source

I created my own theme (not diazo) the classic way via terminal - I used most of the sunburst parts and redesigned them.
The problem is on my local computer and a vanilla plone 4.16 install everything works fine but on the server the theme uses parts for e.g. the navtree.css (in my theme empty) that seems to be part of the classic plone theme and I really don't know why.
Any ideas?
This means the installation on your local machine differs from the one the server.
I only thing I could imagine with the given informations is, that you have a different theme active.
Go to the ZMI (plone root) -> portal_skins -> Properties (Tab).
Check which theme is active.
I guess in your case on the local machine it's sunburst and on the server it's Plone theme classic.
Please provide more informations if this is not the case.

AccessDenied in Orchard CMS 1.4.1

I converted one of my solution to Orchard 1.4.1 with proper database.
Q1: Whenever I run or goto any link by clicking menu item then it always hits to AccountController/AccessDenied method of Orchard.Users. why?
Q2: How to resolve this?
Please help
There are two scenarios in which this may happen:
You updated from 1.3 (or older) versions to 1.4.1. If that's the case - check the 1.4 upgrade information. EDIT: Actually this is probably not your case - you would get 404's, not AccessDenied, in this scenario.
You are using the source code from recent 1.x development branch. There is a new module in the works that will allow to restrict visibility of certain pages to specific users. If that's the case - go to admin screen and assign Page "View" permissions to Anonymous role.

Change a website's directory names per installation

Is there a way that I can have different directory names per installation of a website? As in I would need to rename the directories at build time or some similar solution. I am currently using MSBuild with CruiseControl.NET.
An example would be I have a module in my website called Bug Tracking which is then in http://mysite.com/BugTracking/.
One installation wants to leave it as BugTracking and another would like to call it "Issue Tracking" for whatever reason and have it in http://theirsite.com/IssueTracking/.
Re-writer rules
You could set up a re-writer rules so you could leave the directory name the same, and just add a re-writer rule for the clients that want it call something different?
IIS7
also look at Scott's blog
Doesn't solve the problem, kind of hides it I know. but its easy :)
or
ASP.NET Routing:
Also worth looking at would be ASP.NET Routing,
Using ASP.NET Routing Without ASP.NET MVC
or
Using Routing With WebForms

Best DotNetNuke url rewriting approach?

I would like to implement a URL rewrriter for DotNetNuke. Have questions as to whether this is a good or possible approach and any suggestions other developers may have.
Can I add a dynamic or static route for URL rewriter from the 'Pages'-> 'Add Page' section?
Let's say I'm creating a page called 'Events' underneath the 'Activities' menu item.
Can I write some custom code in DotNetNuke that will add a prompt on the add page screen that assumes I will want a static or dynamic route added for - site.com/Activities/Events Or if I name the page 'Event Calendar' then it would suggest 'site.com/Activities/Event-Calendar'?
I would like any feedback or suggestions on how I would accomplish this! Thank you.
If you're using DotNetNuke 4.8 or greater, you just need to enable Human Friendly Urls through the Web.Config.
To enable human friendly urls, replace:
<add name="DNNFriendlyUrl" type="DotNetNuke.Services.Url.FriendlyUrl.DNNFriendlyUrlProvider, DotNetNuke.HttpModules" includePageName="true" regexMatch="[^a-zA-Z0-9 _-]" />
with:
<add name="DNNFriendlyUrl" type="DotNetNuke.Services.Url.FriendlyUrl.DNNFriendlyUrlProvider, DotNetNuke.HttpModules" includePageName="true" regexMatch="[^a-zA-Z0-9 _-]" urlFormat="HumanFriendly" />
UPDATE:
For DNN 7.x and greater, this should now be:
<add name="DNNFriendlyUrl" type="DotNetNuke.Services.Url.FriendlyUrl.DNNFriendlyUrlProvider, DotNetNuke.HttpModules" includePageName="true" regexMatch="[^a-zA-Z0-9 _-]" urlFormat="advanced" />
Additional Detail: Enable Human Friendly Urls in DotNetNuke
Check this out - details here:
http://www.ifinity.com.au/Blog/Technical_Blog/EntryId/19/Rewriting-the-DotNetNuke-Url-Rewriter-Module/
Also, take a look at the existing FriendlyUrl module that's already included in DNN.
If you want to do this on the stock pages, you'll need to crack open the source for it, or write a module that does this independently.
To answer your question directly : yes, you can add some code to the DNN Page Settings page. However, you'll be modifying the core code and thus won't be able to easily upgrade your installation when the next DNN release is made.
A lot of people come to DNN and want to write a new Url Rewriter. The problem is not the rewriting : it's getting the DNN framework to generate the correct urls where you would like them - in the menus, in generated links within modules. To really change the rewriting scheme you need to replace/augment the Url Rewriting function, the friendly url generation function, and provide some sort of redirect capability in order to tie old and new Urls together.
Another suggestion is Page Blaster, if you are not wishing write your own code. Works well for the sites l use it on.
Several of these are great replies... One of the most important things to know if you are just learning about DNN now (2016 and above) is that the realm of URL Rewriting has changed over time within DNN.
Before, in DNN 4.8 and below you had to use an external module/provider such as:
PageBlaster or
DNN Masters SEO URL REWriter or
iFinity URL REWriter
all of those are mentioned in some of the answers above.
However, after DNN 4.9, iFinity URL ReWriter was incorporated into the DNN core and you'll find it available in DNN 5, 6, 7,and 8 in different levels of exposure to the interface. You still need to do some updates in the web.config, but much of it is done directly within the Page Settings now.
Any settings that are not within the main managers, you can do either in the web.config, or in the database, or you can look for a DNN module such as X3 DNN URL Management which taps into the database records of the integrated DNN url rewriter and helps manage settings (it is very similar to the old iFinity interface screens/options) but you don't need it, you can work directly, it's just helpful.

Resources