language specific pages are confused while creating a new portal from "Portal template" in bilingual portals - multilingual

While creating a new Portal (dnn 5.6.1) from "portal template" which is created from a bilingual portal(en and tr), all pages(both en and tr) are created in one language. if I activated the second language creates another set of pages for both en and tr pages.
I tried creating a portal template while the second language is disabled but result is same.
do you have any idea to overcome this issue?

My hunch is that, at time of writing, this is an outstanding issue that can't be resolved directly through the UI (I say that because it sounds like you tried every reasonable measure).
If that is the case, your best bet would probably be to edit the generated portal template XML file and remove the elements that represent the second languages pages prior to importing to your target dnn instance. Then you could enable the second language and it would replicate the first language's pages and you could re-localize them. (Hopefully you don't have a ton of pages!).
Alternatively, you could potentially export page level templates for the second language and import them after you've done the import of the portal in the first language. If you take this path, and you have a lot of pages, you may export individually but "bulk import" them by placing them in the /Install/Template folder and hitting the /Install/Install.aspx?mode=installresources URL.

DNN 5.6.1 and i believe also DNN6 has serious issues with exporting/importing multilingual portals. From what i read, the multilingual issue is overcome in DNN 7 which is a major update.
One way to work with legacy multilingual DNN sites is this (far from ideal):
The template which is going to be exported must be in only one language. You may not press the "enable content localization". This is the moment after which export/import becomes very messy.
You export the single language template (this you must keep as the backup point)
Now you import your template.
Then you enable other languages & content localization button (wait till pages are created)
Now you enter the content into the second language pages.
No backups can be created, so you can only backup the content you have entered in the second language, manually..
In any case i recommend you start fresh with DNN7 or a different CMS altogether (WP, Drupal, Joomla...).

Related

Standard method to find and edit front-end files in CakePHP

I have recently been asked to take over the administration of a website that is built on CakePHP 3.x.
I have never worked with CakePHP before. Everything I have read talks about using a command line interface, but I haven't done this since I was in Uni.
I discovered a Dashboard on the website where I can enter or edit the products, but I was wondering about the pages on the site.
I had to change some phone numbers in the footer of each page and it was only hunting through the files that I found src/Template/Element/footer.ctp and edited this.
Is there some way of editing the pages without finding the individual files?
No. What you're referring to (the command-line stuff) is for when you're baking files, running shell tasks, doing database migrations, installing things via composer, or using the built-in local server...etc. There are other uses too, but editing front-end files is not usually one of them.
Though there are methods for altering local files via command line, for the things you're talking about, like editing a footer, or other pages (.ctp "Template files" in Cake 3), it's standard practice to just do that manually.
See the standard path for template files in these examples:
src/Template/Users/profile.ctp
src/Template/Pages/contact.ctp
src/Template/Layout/default.ctp
A "layout" file usually fetches the header, content, and footer.
As you've found, there are also Elements, which are smaller chunks of code that are reusable across one or more Template files.

Hiding the word "joomla" from a script in contact form

Whenever i create a contact form in my Joomla! 3.3.6, some script appears in the the page's HTML code that contains many words Joomla in it. I'd like to change those Joomla words and replace them with another words (i.e. Foo) for some security issue. I'd like to know whether or not i'm able to do so and how.
That script is:
<script>(function(){var strings={"JLIB_FORM_FIELD_INVALID":"\u0641\u06cc\u0644\u062f \u0646\u0627\u0645\u0639\u062a\u0628\u0631:&#160"};if(typeof Joomla=='undefined'){Joomla={};Joomla.JText=strings;}
else{Joomla.JText.load(strings);}})();</script>
I have no idea whether a plugin or an extension creates it or not.
Thank you
Regards
This script seems to be translating some text required for the form to use in its javascript, eg validation messages. It does this using a javascript version of JText, which is part of core Joomla. There is some info on how that works here. Weirdly, there seems to be little information in the official Joomla documentation about it.
The main JText function it is calling appears here: media/system/js/core.js
I'm sure it would be possible to write a plug-in to remove this script before the page is rendered and then to translate any untranslated text with your own scripts. However, I'm not sure I see any security benefit in doing this so it seems a waste of time.
Ultimately, someone sniffing a site for what it is built in is far more likely to see if core files exist by going direct to places like media/system/js/core.js, rather than to scan the code for the word "Joomla" - which would trigger a lot of false-positives (any site which just mentions Joomla) and negatives (any page which doesn't have a form on it). It also does not reveal the version of Joomla, which is the info a hacker would more likely be after.
I think you have to search for the script (i.e via Notepad++) in the whole directory. It must be a plugin for the contact form that has some inline script in it.
also do you use any special third party plugin or so? that might be the source of it.
PS: also i had some similar experience, i don't know exactly how i got rid of those words, but like you, i wanted to do that to hide the fact that i'm using joomla for security.
Its actually Joomla who add this, from the file: Joomlainstall/libraries/joomla/document/html/renderer/head.php
And load it globaly from:
Joomlainstall/libraries/cms/html/formbehavior.php
The developer ad that code by using the function, JText, for an example:
JText::_( 'COM_CONTACT_EMAIL_FORM' )
In my case it was the plugin ContactUs Form who add the javascript. If JText is not used, it is not loaded. If I disabled the plugin, the javascript was then not loaded. If you have that plugin enabled, my be try an other contact form?
For security reson it is bad programming by the developer off Joomla, for sure.

Migrating data from one DotNetNuke portal to another

I have a pretty old DotNetNuke installation which is broken (in more than one way) and won't let me upgrade. I've set up a new installation and want to move the content. The old portal has a massive amount of data, so moving it manually will take very long.
Is there any way of migrating between portals without manually copying?
I know tools exist to do this between SharePoint portals.
I'm capable of doing SQL and even writing a few lines of code if required.
It depends on where your data is stored. Some modules will implement the "Portable" feature, which means that you can export them with content. However, there's not even a great way to export all of your content at once. You can export a portal template (from Host -> Portals), but if you're upgrading a lot of versions, the new version won't be able to handle the old version.
If your information is in a lot of different modules that don't support the "Portable" feature, you'll need to consider each of those modules separately (probably doing some sort of SQL export specific to each module).
I'm facing this issue now. PokerDIY.com has a massive amount of user-dependant data but runs like a dog. I want to start fresh on DNN 7.1 with a clean install and move the relevant data across and make new pages and content. (I guess by not moving the modules and tabs across it is a bit easier).
Considering the Users will get a new UserID I will have to use email address to map any table with a USerID from the old DB to the new one... this is going to be no small task ;)

Team working on Drupal - Tips

I am working on a Drupal site with a few friends. Obviously we can Version control the code... but what do we do to keep each others databases in check?
I have managed to get all the theming into files (contemplate etc), but ideally my views settings, menu settings would be in line also... (Not worried about Content either way as we're just building the framework)
Any suggestions?
Using Features along with Context is very powerful. Context lets you create a "section" for your site. It's best illustrated through an example:
Lets say we define the "Forum" context as anything with the url of forums/*. Context lets us say: "I want to show these three views in the right side bar, only when I am in the "Forums" context.
Now, using Features, we can create "module" define by the context. So, we will end up with a module called "youSite_forums", which will include all the views, blocks, etc. that was define in your Forums context. It also will determine the correct dependencies, as well as Content Types used in the context. All will be bundled up nicely in a module.
As for versioning content such as node, you can user either Node Export, or just do a DB dump using Backup and Migrate. We use these occasionally, but we never have every node versioned in SVN.
Links:
Features
Context
Backup and Migrate
Problem Solutions in Database Migration from Development to Live Sites
You can find some more opinions on this here: Drupal DATABASE deployment strategies?

What are your recommendations for reducing the number of resources (JavaScript and CSS) that DotNetNuke loads?

The home page for DotNetNuke 5.2 is around 252.6KB. It uses 15 JavaScripts and 8 CSS files. The number of resources DotNetNuke uses seems excessive to me. I am looking for best practices creating DotNetNuke skins that limit the JavaScript and CSS resources.
You can use the Unload CSS Skin Object to remove links to some of the CSS files loaded by the framework (like Default.css, portal.css & any module-specific CSS files). You can then move all of those styles into the skin (or portal stylesheet, whichever is your preference), so that there's only one stylesheet that gets loaded.
I don't know of any solutions for combining JavaScript resources or reducing the number of scripts that DNN requires.
From 6.1 onward, the Client Resource Management component is the solution for this. It automatically combines all your files, cleaning them up, removing comments, and minifying if desired.
http://www.dotnetnuke.com/Resources/Wiki/Page/Client-Resource-Management-API.aspx
It takes a little getting used to, but the control is quite nice. You can decide which order they'll go in, you can group the files in bunches if you don't want one big single file - maybe you want certain bunches of scripts together but not all.
One thing to remember is that when you're doing development (as noted by the comment below, which I've since edited this post), you should always use debug=true in the web.config, otherwise if you are using Resource Mgmt and change your source files, you'll constantly need to regenerate the combined files by going into Site Settings, Client Resource Management, and increment the version. It's kind of a protection to keep anything from altering your clients' browser caches without intent (that's the message box that pops up to let you know when you do it). I'm sure if you have a zillion users this might make a difference.
Part of that is just the dynamic nature of DNN - there are some good resources that R2i has published about combining javascript and CSS
One concrete suggestion is to combine all your skin and contianer css in one file and if you have full control of the site to combine the css from the modules you use into that same file.
I know with the addition of the Telerik controls there is some abilities to combine resource files
Another thing that helps is to combine graphics into a single file and use CSS (the sprite technique) to cut down number of files loaded and calls to the sever
Like it was stated above, it's the nature of the beast. Each module will have at least 1 css file included. You can check out PageBlaster from snapsis.com, I believe it will do what you are looking for.

Resources