Override replace module tpl file - overriding

I can't override a template module tpl on prestashop. I have put my new tpl file in theme/module, try in override prestashop folder, no work. Clear cache no change.

To override a module tpl you have to copy the folder structure and the file you want to override into your theme.
For example if you want to modify the front.tpl of the module modulename and you have a theme called yourthemename
you will have to copy:
/modules/modulename/views/templates/hook/front.tpl
to
/themes/yourthemename/modules/modulename/views/templates/hook/front.tpl
Note that the folders may vary but you have to keep the structure.
Once the file is copied you can edit it and it will replace the contents of the tpl

Template overrides for PS Modules (for 1.6 and 1.7) belong in the themes/[YOUR_THEME]/modules/ directory.
Now depending on the module you're trying to override, you might, or might not, need to create additional subdirectories like views/templates/front or views/templates/hook. Just look at the location of the original module tpl file to get the exact path.

Related

How can I create directly my own rss.xml in OctoberCMS?

I want to generate rss.xml file in OctoberCMS by manually. Other plugins cannot be customized what I want. How can generate it by my own hand? Any suggestion?
You could use the File::put method to place an XML file within the theme assets public folder.
File::put(themes_path('mytheme/assets/somefile.xml'), $xmlContents);

How to include a css stylesheet in Orchard module?

I am working on a module for Orchard, and I just want to know how to include a css file.
I have done the following with no result:
Added a folder "Styles" to the root of my module and included a stylesheet and a Web.config file like in this question.
And I have seen this but that's not what I am looking for.
EDIT:
Ok, solution:
When I started working on Orchard I created a new module by just creating a new project in Orchard.Web/Modules folder, but as I read here, my Views/Web.config file has to include some orchard base things what mine didn't because I did not create the module using codegen. I fixed it now by replacing my Web.config file for a Web.config file from another Orchard module, now it works.
Next time I will use codegen to create a new module.
Thanks to endorphin for helping me!
If you want to include your stylesheet in a view, you need to specify this at the top of your view. Where the name of your stylesheet is the filename of the .css file in the Styles folder.
So in your .cshtml file for your view..
#{
Style.Include("your-stylesheet.css").AtHead();
}
I have used AtHead() in the past, but there are other methods to include your stylesheet in different locations (such as AtFoot())
If your stylesheet depends on other stylesheets you can do something a little more interesting by creating a Resource Manifest which is detailed here https://stackoverflow.com/a/6500121/580101

How to theme Lightbox

I need to theme my lightbox. I can see the HTML generated by the JavaScript code in lightbox.js, but I cannot overwrite that file, or I will lose my changes when I update the module. Is there any better way to override a theme output?
You didn't report for which Drupal version you are interested; the answer I am giving is valid for Drupal 6, but few things would change for Drupal 7.
Lightbox2 uses a template file for its output. If you create a custom module that implements hook_theme_registry_alter() to use a different template file, then you can use a template file that uses a JavaScript file you wrote.
can you not theme it just by changing the CSS?
In your theme's .info file you can override the module's css and/or js and then you copy the css or js file from the module into your own theme folder, (every theme should have a .info, if not create one) - this means you don't touch the actual contrib modules files
Drupal will then use the one from your theme, which you can edit to your hearts content, and if you do hit problems you just remove the entry from the .info file and it will then go back to using the original module filea.
I haven't done it for JS but I believe the process is the same as for CSS and here is a snippet of what's in my .info file - btw I think once you use this method of overriding you have to declare the default style.css too
stylesheets[all][] = style.css
stylesheets[all][] = lightbox.css
Update:
It's only possible to use the .info file to override JS in D7, but there is module JSAlter which might help with D6

How do i change the index.html flex output to admin.anotherExtension?

i need to change the automatically generated index.html flex output to admin.anotherExtension. I understand that if i change the index.template.html the changes in html level will be preserve when the file is generated, however i need to change the name of the file also, and the extension.
Thank you! (using flashBuilder4)
In the html-template directory. Create a new template file named something like this:
${application}${build_suffix}.template.cfm
The next time you build your project, you'll get a file with the extension .cfm that is the same name as your application. You can use whatever extension of your choosing. My source
If you create your own file in the html-template directory (say: index.cfm ), I'm pretty sure that file will be copied to your build directory, but not changed.
Keep in mind all your changes will be overwritten if you change the Flex SDK on the project. Back them up somewhere.

Drupal theme files outside of theme folder

Is there a place where I can place override theme files other than a theme's folder? For example, if I wanted to override the appearance of a view's row in the same style for more than one theme without having to use more than one file.
If there isn't a generic way to do this (for any theme file), is there a way to do it for a view's theme files?
In your module, you can use hook_theme to declare a theme function or template for your view's row. This way, your single template will be used by all your themes without any special code in them. See the Theming your views in your module section in the Views's API Advanced Help page.
You could include an include_once type statement in your tpl.php file and just import the code from where ever. This way you have any number of files that refer to one.
It is not recommended though since if you move your theme folder or rename anything this can be harder. Also if you put your theme in another site you need to keep track of all of these off-theme hacks.
I think views seeks tpls inside of the theme folder. It's be nice to have something like that though.

Resources