joomla: customize text in user menu - templates

In the user-menu module, I want to change the text in the div.login-greeting element (which is a child of the form#login-form element).
Right now, it says "Hi Steph," (supposing the username is Steph)
I want it to say "Hi, Steph".
That's all.
I can't figure out if what I need to do is a template override or something else... because I can't figure out where the heck these elements come from. I am fairly new to Joomla, and intermediate in php. I've found working with the module manager, adding class suffixes, placing module positions in index.php, etc. all quite straightforward. I did a template override for the login module, with no trouble. But the menu module is baffling me. Looking at the default.php, I can't even figure out how it puts the form in there when it's a user-menu and not just a normal menu. Where does this form come from?? How can I change it???

Go to language>en-GB>en-GB.mod_login.ini and change MOD_LOGIN_HINAME="Hi %s," to MOD_LOGIN_HINAME="Hi, %s" and save the file.
EDIT
If you need to change more strings it's better to create a file en-GB.override.ini inside language/overrides and put only the strings that you want to override from any extension. For example it might contain only:
MOD_LOGIN_HINAME="Hi, %s"
MOD_LOGIN_REGISTER="Click here to register"

Related

Is there anyway to rename the "Source" button to something like "HTML"?

Is there anyway to rename the "Source" button to something like "HTML", I ask this as users are confused at how to add html code using the editor?
Yes, inside of the "lang" folder you will see all of the various language files.
For my case, and probably yours, You will want to edit the file "en.js". The file is "compressed" to some degree so it may be difficult to read, but it's still not too difficult to change one string. If you do plan on changing multiple strings you will most likely want to use a service to format Javascript.
Search for the following segment of code. It was one of the very last lines in the file.
"sourcearea":{"toolbar":"Source"}
change it to
"sourcearea":{"toolbar":"HTML"}
Avoid This Method Unless Required
And as for a very unsuggested method, since you can't modify the language files for some reason, you can modify the ckeditor.js file and force a specific label.
Inside of "ckeditor.js" change the line below
a.ui.addButton("Source",{label:a.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"});
to the follow code
a.ui.addButton("Source",{label:"HTML",command:"source",toolbar:"mode,10"});
The only thing modified is the "label" value in the above line. We remove the reference to the a.language.sourcearea.toolbar and insert a string in it's place instead.

How to customize Sitecore workflow Comment box

I am working in Sitecore 7 and want to customise the comments textbox. I need following functionality:
Instead of Single line, I want to replace it with multiline.
Is it possible to have rich text box instead of single line to allow users to put more meaningful comments and those are visible in History too.
You have to modify a lot to do it. When you approve button is called this command :
<command name="item:workflow" type="Sitecore.Shell.Framework.Commands.Workflow,Sitecore.Kernel"/>
with some parameters
Inside this class you have next method :
protected void Run(ClientPipelineArgs args)
{
...
where you find next lines of code that is called to show single line input :
...
if (!flag1 && flag2 && !flag3)
{
SheerResponse.Input("Enter a comment:", "");
args.WaitForPostBack();
}
Yes, this is possible, but you'll have to essentially recreate and replace some basic functionality to do it. And worse... it will require use of SheerUI, which is not documented anywhere from Sitecore that I know of. You have to figure it out by disassembling existing code. If you look at Sitecore's implementation of say, the Approve action, you'll see there is a SheerUI call to get the comment text. (not looking at it right now, so I don't know exactly where this is) You'll need to replace this with a SheerUI call to load your own custom dialog. How do you do this? Well... man, wouldn't documentation on this be nice?

woocommerce advanced templating

i´m developing a theme and for some reason i need to move the default position for breadcrubms (also for many other things) over woocommerce themes. Then i realised to do something like this on my functions.php:
function woocommerce_remove_breadcrumb(){
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20);
}
add_action('woocommerce_before_main_content', 'woocommerce_remove_breadcrumb');
function woocommerce_custom_breadcrumb(){
woocommerce_breadcrumb();
}
add_action( 'woo_custom_breadcrumb', 'woocommerce_custom_breadcrumb' );
And then on any template file, output the breadcrumb just with:
<? do_action('woo_custom_breadcrumb'); ?>
And works. My question is more than that. Is this the correct approach for something like this? I mean for anything over woocommerce, not just breadcrumb, for any pice, ratings, titles, buttons, sidebar, and so on.
What i´m thinking on is why woocommerce templates don´t come with more deep code. I mean, why there´s no such a single-content-loop.php template where you can just change the order of things, title, category, content, images, etc. in an easy way rather that hooking into functions?
I think that is an acceptable way to call the breadcrumbs explicitly. Sometimes it is easier to call a specific function than remove everything around it!
As for changing the order of things and getting into advanced customization; there isn't a single file, but a number of files working together. Create a folder in your themes root called 'woocommerce' and copy the following files for a safe override:
woocommerce/woocommerce-hooks.php:
Here are your hooks, including the ones you are overriding in your themes functions.php. Here is where you can experiment with removing and repositioning certain elements on your product page. Search for 'Sidebar' and you will see where the 'woocommerce_sidebar' action is added with the function it references in...
woocommerce/woocommerce-template.php:
Here are the functions used in template files to output content based on conditional statements. For instance, search for the 'Single Product' series and you can see which template files are used for which functions. For instance 'woocommerce_template_single_title' uses 'single-product/title.php' - if you copy over this folder and file you can make very specific edits to just the title section
Between these two files and their accompanying references (like title.php) I believe you can do the things you described. Let me know how it works out! I'm new to woocommerce too!

drupal 7 custom content type and templates

... ok ... so ... i just needed to "clear cache" after all that. i thought because i don't have caching on (site is in development) i wouldn't need to clear it. wrong.
the solution was:
add the file node--my-content-type.tpl.php and go to Administration » Configuration » Development then click the clear cache button.
i hope this helps someone not spend hours on end solving this same problem!
Using Drupal 7.2, I have created a custom content type 'my_custom_type and I can't for the life of me figure out how to create a custom template for my custom type. My template file at the moment just prints "hello world", but no luck displaying it. I've tried these combos of things:
putting node--my-custom-type.tpl.php in the my theme's templates directory. That didn't work. So I, after researching, added this to my THEME_preprocess_page() function in templates.php:
if (isset($variables['node'])) {
$variables['template_files'][] = 'node--'.
str_replace('_',
'-',
$variables['node']->type);
}
putting that same code in THEME_preprocess_node() without the if, so:
$variables['template_files'][] = 'node--'.
str_replace('_',
'-',
$variables['node']->type);
both of the above but with my tpl.php file in the base template directory: /modules/node/
Any help would be tremendously appreciated. I'm at a complete loss.
Also, I added print "what the what" in /modules/node/node.tpl.php and it printed.. maybe this is because the content-type isn't a node? but then how to create a default template for a content type?
It's not advisable to modify core files. See http://drupal.org/best-practices/do-not-hack-core. I'm not sure if this is what you're doing, but if you are...
What you should do instead is create a subtheme. See guides at http://drupal.org/node/225125 and http://drupal.org/node/171194
Usually you would put your custom theme files in /sites/all/themes/custom/subtheme_name/ node--my-custom-type.tpl.php.
Remember to clear your cache at http://yoursite.com/admin/config/development/performance so that your new template files are recognized.
If you want to avoid having to clear your cache all the time, you can install http://drupal.org/project/devel and choose to rebuild the theme registry on every request.
Be sure to turn it off before your site goes live, as leaving it enabled incurs a huge performance it.

Adding views/blocks programatically to tpl.php files in Drupal 7

I am trying to integrate the awkward showcase into my page--front.tpl.php. My first idea was to create a custom content type (slideshow image) and then a view that prints a list of those images. I was able to create the view and set it to be available as a block... but I have no idea how to include that block via my .tpl.php file. I don't want to just use the content region because it displays a bunch of "hello welcome to $sitename" messages that I couldn't figure out how to remove.
Also, what is the naming convention for views blocks? The machine name for the view I want to create a template of is called 'front_page_slideshow'
There's a way of adding views programatically,
the easiest way is using "views_embed_view()" http://api.drupal.org/api/views/views.module/function/views_embed_view/7
$view = views_embed_view('view_name', 'display', $args);
print $view;
For render a block (any kind of block) use this simple script I created:
https://gist.github.com/4001153
I would create a region['slideshow'] in your template. Then you assign the view that you've already created into it as a block. If you want to get really simple, till you figure how to drupal properly, you can just hack your page--front.tpl.php file and use include('yourslideshowfile.php'); to simply include your file there.