Joomla - Rearrange layout of User Registration and Profile - joomla

Good day! I would like to ask how will I be able to re-arrange the layout of the user registration and profile page.
I am not describing adding/modifying fields, but to re-arrange them as to how this is rendered in the front-end. I will be using three fieldsets instead of the default one per plug-in, because they are subdivided into three.

You can override the "com_users" component's "registration" view.
To override the view, simply add a file in your template.
location:
TEMPLATE_NAME/html/EXTENSION_NAME/VIEW_NAME/FILE_NAME.php
For your case it must be TEMPLATE_NAME/html/com_users/registration/default.php
You can read HERE for more about overrides.

Related

How to set theme id property on Components?

Whatever I do, only theme set in application properties applies. Theme id doesnt work as expected.
For example:
I have two custom controls and each has 5 views. I try to set view title property for all views in first custom control with theme and same with second custom control, but with different theme (and title).
Both custom controls exist on same page.
Problem Im trying to solve is, instead of typing functions for properties for each component of same type I want to do it only in one place. In that case all views in one custom control. Or all views in a panel...
Regarding Themes: afaik we only can define a single theme per application. This theme can inherit from other themes but those need to be installed and registered at the file system level for the entire server.
Regarding your scenario:
If you really want to solve that with themes you could work with separate theme ids. But I really don't see the benefit of using themes here. As far as I understand your task I would solve it using custom properties for your custom controls. The view title would then be computed to reference that property as in
<xp:viewTitle xp:key="viewTitle" id="viewTitle1"
value="#{javascript:compositeData.ccViewTitle}">
</xp:viewTitle>
At design time the containing Xpage or Custom Control would then feed the appropriate view title to the child control:
<xc:ccInner ccViewTitle="View Title for First CC in Page"></xc:ccInner>
<xc:ccInner ccViewTitle="View Title for Second CC in Page"></xc:ccInner>
You also could compute this value, if necessary.

Adding custom fields to the article component

I've recently added custom fields to the article component using the documentation in the following url:
http://docs.joomla.org/Adding_custom_fields_to_the_article_component
Now this adds the custom fields defined to every new and existing article. Is there a way to define custom fields for specific article layout overrides.
Example:
If I have custom layouts for the category blog, (news, portfolio, events) can I define different custom fields for each category when creating a new article?
Kind of the way custom post types work in wordpress, or the way k2 component works, can this be done in joomla alone?
This is considerably easier to manage in K2 since the functionality is built in to do specifically what you want. It is trivial to assign extra fields to each category without having to go through the much more complex process described in your link.
However, if you want to stick with com_content, then you will need to create alternative layouts for displaying each category. You will still have all of the custom fields show up in the admin, but you can control the display on the front end with the alternative layouts. Here is the documentation (it's the same for 2.5) - http://docs.joomla.org/Layout_Overrides_in_Joomla_1.6#Introduction_to_Alternative_Layout_Feature_in_Version_1.6

MVC3 global predicate filter

I am building an admin console and all controllers depend on a dropdown selection for customer.
I would like to move this customer selection to the layout and persist it across all controllers so that you do not need to select it everywhere.
What is the best way to go about doing this?
Thanks in advance.
Move the dropdown to your _layout.cshtml.
Create a BaseView that all views will inherit from and give it a property to store the Customers & Current Customer.
Create a BaseController method that will fill in a BaseView instance.
Store the currently selected customer on your session.
Create a Global Filter and have it check all views to see if they inherit BaseView. If they do it can convert them to a BaseView and then fill in the properties.
Write some code in the _layout that can use the View to fill in the dropdown. I'm a bit fuzzy here since my coworker actually did this part when we did something similar.
When the user changes the dropdown value you can use JSON to call an action method that will update the current customer in session.
I would consider writing HTML helper. You assume that all the birds can fly, but say one day you have another exceptional scenario and you no longer need this dropdown box. Alternatively include it in a partial view and render that view where you need it - it's only one extra line of code.
E.g.
#section main_content{
#{ Html.RenderPartial("MyPartialViewContainingDropDownBox"); }
}

How do I create an editable field with a Save button on Magento Admin's Order detail page?

I've already created a custom module that overrides the sales/order/view/tab/info.phtml layout file and creates a new field in the sales_flat_order table. Now I need figure out how to add a text input field to the order page:
The save button doesn't necessarily need to be right near the custom field and the field doesn't need to necessarily appear right where I put it in the graphic. Bottom line is, the administrator needs to be able to edit my new custom field in the admin.
What is the best way to do that?
Look at Comments History block
implementation - class Mage_Adminhtml_Block_Sales_Order_View_History, its template \app\design\adminhtml\default\default\template\sales\order\view\history.phtml and Mage_Adminhtml_Sales_OrderController::addCommentAction(). You should create similar block class with similar template and create controller with action which will save form data to your db field.

Handling site wide data in MVC Razor

I've seen this question asked in a couple of places and generally the answer has been "use the ViewBag" which I don't think fits our scenario.
We have a membership site which has common properties (e.g. Account -which contains the user's account settings) and I would like to use that in both the Views and _layout.cshtml (e.g. to allow the user to change the colour scheme).
In the views, we're inheriting from a base view model but how can we get access to this data in the standard pages e.g. About Us etc which don't have any associated view model? I've tried creating a partial view which passes the data through in it's controller but that didn't work
Your main options are:
1. Consider implementing a profile provider - the settings are then available everywhere, use an Action Filter
2. use your own custom context assigned to the current request/user
3. use a base controller/base viewmodel for the pages that don't have them
4. use a global action filter
5. viewdata/session
See some details at:
ASP.NET MVC 3 layout ViewBag data across all child views
if you already have this working and need access in an "About Us" page and don't want another view model (why not?) then an action filter would be the way to go - unless this is a typical aspx page in that case you are left without options 3/4 above.

Resources