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.
Related
This page: /my-account/view-order/132616/
... is associated with the view-order.php template file under the my account section. I am able to edit this by going directly into the woocommerce plugin dir, but copying the file into /my-child-theme/woocommerce/myaccount/view-order.php does not have any effect. I am able to edit the orders.php template in this manner, but not this one. I haven't been able to find any answers online to this one: why some of these template files can be copied / overwritten and some cannot be? Also, there appears to be limited scope on applying a hook to manipulate the content on this page. What I want to do, is turn the product names listed here into links back to the products in the store. Thanks for any help!
turns out this doesn't satisfy my need since the content I'm trying to manipulate is in the woocommerce_view_order do_action. Now I'm on the hunt for a filter hook.
I've created a new page Aikau, but I changed the XML file and the rendered page content between the standard Share header and footer disappeared.
In this page, I want the arguments of the query string, so I write this code:
page.get.desc.xml:
<webscript>
<shortname>My New Page</shortname>
<url>/hdp/ws/my-new-page</url>
<authentication>user</authentication>
</webscript>
page.get.js:
function main ()
{
// Get the args
var fileProp = args["test"];
model.temp = fileProp;
}
main();
page.get.html.ftl:
Test arg: ${temp}
I have to put /hdp/ws/my-new-page in the XML file to write the content of FTL file in this page... But why did the header and footer of the Alfresco template disappeared ? hdp serves for this purpose. And if I don't put the URL like that on the XML, the page appears with the template.
What is wrong in my code? Or how can I recover the template? Or add header and footer?
EDIT: I already try to put only /my-new-page without /hdp/ws/ but the args are null when I put /hdp/ws/. Give me a hint.
EDIT2: I already try to import alfresco-template.ftl but I can't. Any idea?
You don't actually need to include the the "hdp/ws" part in your WebScript descriptor. Only the "/my-new-page" is required. Aikau attempts to simplify the Surf page creation by providing a number of pages out-of-the-box (and the "hdp" page is just one of them).
Aikau uses URI-template mapping to match a single WebScript to a page, so for example in the URL:
/share/page/hdp/ws/my-new-page
share = application context
page = Spring MVC request dispatcher
hdp/ws/my-new-page is then mapped to the URI template:
<uri-template id="share-page">/{pageid}/ws/{webscript}</uri-template>
Where "hdp" is the id of the page to render and "my-new-page" is the WebScript URL. The HDP page uses the "webscript" token from the template to automatically create a new Surf Component and bind it to the WebScript.
But in short - don't include "hdp/ws" in your WebScript URLs for Aikau pages.
You need to make the things that you have on javascript server in this javascript mandatorily? If not, you can create a javascript client that receive the same arguments (location.search give to you the query string, so, you can make parse of that query string and get only the value of the "test" that you want) and call them on FTL file (the client-side javascript). So, when the page loading, it does not lose the arguments. It isn't the best solution but you can try this...
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"
List template in dynamic data list in Liferay
I have already read this post and also another webapplicationdeveloper blogpost but not find any idea to get action button in customly applied template to dynamic data list.
I have also tried including that default record_action.jsp of dynamicdatalist portlet in vm template but its not working and also set the property below
journal.template.velocity.restricted.variables =
in portal-ext property but still I am not getting the action button in my custom template
I have already tried this :
#
set (
$categoriesService = $portal.getClass().forName("com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil").getMethod("getService", null).invoke(null, null))
My answer is: Yessss, it works. But I want use a jstl lib (e.g. <aui> or <ui>) as well. In my opinion the simpliest way to do it is include jsp file to themeServletContext. Put your file.jsp into your theme:
your-theme/docroot/path/to/your/jsp/file.jsp
and paste this piece of code into your vm (for example portal_normal.vm):
$theme.include($themeServletContext, "/path/to/your/jsp/file.jsp")
In this case it unable to find the $theme variable my page displaying the $theme as it is...:(
Please help:
Leave velocity, it's too poor to use taglib, and switch to freemaker language: more powerfull and full support of taglib.
Here there is an example to use freemaker for theme develment, but it's good starting point also to template in dynamic data list.
https://www.liferay.com/it/web/mika.koivisto/blog/-/blogs/using-freemarker-in-your-theme-templates
Look also freemaker guide: http://freemarker.org/docs/index.html
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!