How to modify the imperia cms user interface? - user-interface

How can the user interface of an imperia 9 CMS be changed without
loosing the changes with the next update or hotfix?

There is a rather safe way to do it.
Say C:/imperia/dev/ is the path of your imperia development system,
then you find the imperia default views
in C:/imperia/dev/site/view/imperia. You can create your
own views in a directory next to it C:/imperia/dev/site/view/mycustomviews.
Now copy a view from the /view/imperia tree to your
/view/mycustomviews tree, keeping the structure and filename and change the content to your needs.
To let imperia know how to find your views, you have to define your your view-template directory
in the system configuration file system.conf.
"VIEW_TEMPLATE_DIRS" = "C:/imperia/dev/site/view/siau/mycustomviews"
updates
This way is rather safe, because you do not change your default. That's important. Don't touch
the files in C:/imperia/dev/site/view/imperia. You may loose your changes with
the next update.
But you should know that you may do not participate in fixes or changes concering this view. Let's think of a
optimization to the default view (may be to the behavior in a current browser). With your own view you overlay
the default and you do not get the changes in your GUI.
development
While developing your new views you should add the following lines to your system.conf:
"IMPVIEW_ERRORS" = "HTML,JS,STDERR"
"IMPVIEW_DEVTOOLS" = "1"
"IMPVIEW_CACHE_POLICY" = "timestamp"
With IMPVIEW_ERRORS you can controll where the view errors are displayed.
IMPVIEW_DEVTOOLS adds some develop methods to your views (e.g. dump).
And with IMPVIEW_CACHE_POLICY set to timestamp your views will no longer be cached. Thats great
for development, but you should remove it for productive usage. (The other two as well.)
If something went wrong and you get unecpected results comment the VIEW_TEMPLATE_DIRS line. Then you
get back the default views and you can try to reproduce the problem.

Related

Joomla 3 Overwrite/Change "Menu Manager: Edit Menu Item"

Like the topic say I want to overwrite/change the "Menu Manager: Edit Menu item" layout. To illustrate my question:
In the picture whiche is shown I want to change the labels: Layout, Option, Integration.... and add some other options to it. How can I do it? Or is this even possible?
In order to change the text, simply use language overrides, google is your friend.
In order to add functionality, let's first of all explain what we're talking about to ensure we're on the same page.
Joomla components have views which can have one or more layouts, i.e.
/components/com_content/views/category/tmpl/ contains two layouts, blog and default.
A layout can additionally contain an .xml manifest (in our case, blog.xml and default.xml) allowing us to create a menu item for the specific view/layout combination. The .xml file contains the parameters that the user will set, you can add your own as well.
When you want to change Joomla, usually there is a way to do so without touching the core, which would be pretty bad, as any Joomla! updates would break your work.
For the view layouts a special feature called template override was developed, which allows you to create an alternative to the view layout in a safe place (under your template folder, in this case your admin template), and this is the most elegant and effective way to achieve your result.
Beware though, you are just creating a layout, most likely you will want to add functionality, if it's complex you might be better off creating a dedicated component to keep the code clean. Or you can just put all the logic in your view, query the database from there. But in this latter case, get paid, and run away. Never answer the phone to the customer again.
A final alternative is to write a system plugin that will manipulate the page markup after it was generated in the event onAfterRender(). This is a simple and good approach if you only want to add a button or make minor changes, but if you do anything more than that, see the above advise about running away.

Joomla 3 Article alternative layout

I've created an alternative layout for one of my articles which can be applied successfully, but as has been highlighted in various forums: if you view the article using the Single Article menu type the alternative layout doesn't get applied because of an XML override.
I have a Joomla site that is setup for Sales and Support where the article info such as date, hits etc is useful but on the marketing side none of that is needed, hence an alternative layout would work well.
I want to know how to enable my alternative layout using the Single Article menu type - I've already got the layout how I want it (testing it by having it overwrite default.php) but want to set it up as marketing.php instead and only have it applied to what is needed.
You're probably not going to like this answer because you have already written you're alternate view. If you were rewriting it to begin with, why would you not write in a way that the side bar parameters (date, hits, ect) are within a container that is only loaded conditionally. This way you would only have one view to worry about and a lot less headaches.

Magento move search result

For some reason when somebody performs a search on my site the search results do not display underneath the search box, they appear on the far left of the screen.
Any ideas of what file this would be configured in?
Let me correct myself it's not the search results but the search suggestions
I can't offer a direct solution to your problem, but turning on template hints might point you in the right direction. In the Admin, go to System > Configuration, Select your store view from the scope drop down at the top left. Unless you're running multi-store, or have changed the name of the default store it'll be called "Default Store View". Then scroll down to "Developer" and open up the "Debug" section. Turn on both Template Path Hints" and "Add Block Names to Hints". This will add a div with a red border around each template in your layout and a heading which includes the name of the template. It will liklely completely screw up your page layout, but will show you which template generated every tag on the page and help you track down the issue.
The DeveloperToolbar extension makes turning this on/off quickly much easier, but I wouldn't recommend deploying it to a production site.
Alan Storm's indispensable CommerceBug is another tool which is very handly for tracking down front end issues. CommerdeBug can show you the layout handles and the aggregate layout XML used to generate the current page. Both of which are useful for determing why a specific block was (or wasn't) included.
So in case anybody else runs into this or wants to move where their search suggestions display it is in styles.css under .searchautocomplete.

Orchard CMS pass data from View to Theme layout

I'm writing a custom Orchard module with a custom Theme. I would like to pass data from the View back to the Layout to change the layout based on data determined in the View.
In my example, I have a left-nav in my theme - certain views should be able to instruct the layout not to render this left-nav.
In standard mvc 3 I would just pass the value up through the ViewBag, but this doesn't seem to be working within Orchard - I'm guessing that the layout code is executed before the View is rendered?
I've looked into using a Shape to move this data around but looks like it might be a little heavyweight for what i'm trying to achieve.
What's the best practice for passing data around like this as an alternative to ViewBag?
Update: After playing around with it a bit more i've just noticed that TempData is being picked up in the Layout - can anyone explain why TempData is transmitted, but ViewData isn't? And is it safe to use from an Orchard POV?
It's easier than that... All templates have access to the Layout shape, which is a dynamic object. This means that you can modify it on the fly, add it properties, etc.
In your specific case, suppressing a zone, you may even be able to just set that to null: zones are just shapes, and in the case of top-level zones they are expandos on Layout. So if you have a zone named Foo, setting Layout.Foo to null should do the trick. As a matter of facts, I'm doing exactly that in one of my themes, to suppress the side bars from my error pages without having to create a specific widget layer:
Layout.AsideFirst = null;
Layout.AsideSecond = null;

Saving wysiwyg Editor content with Ajax

I am writing a cms (on .net) and have structured the whole page to work client side.
There is a treeview that lets you add/remove/move items and define their names in the languages defined. For each language I save the names of the category defined, but when there is HTML content associated with it, i fall into the JavaScript serializer problem that finds the content too long to be serialized.
What would be the best approach to make sth like this work. Shall I change everything to work with postbacks, or try to manually call _doPostBack for the editor content (which I don't want). Thank you in advance.
I guess would be great to make auto-save with time interval which will submit only diffs between current state and previous save. It will do the key if the user will edit it manually, not for copy/paste, of course. It is if we talk about really big data that we need to save.
Otherwise need to find some ways to compress the data before submitting: json+base64, etc.

Resources