Adding menu item to Spree - ruby-on-rails-3

I've created a spree site and using spree_essentials and spree_essentials blog have added a blog to my site. How can I add a link to the blog from my main navigation?
I've created an extension for customization called Theme. It placed this folder into my main project folder rather than in to vendor/extensions not sure if that matters or not.
Pretty new to rails and Spree.
Here's the link for the extensions I used: https://github.com/citrus/spree_essential_blog

To do what you want add a hook inside lib/your_extension_hooks.rb, something like this :
insert_after : sidebar do
# you can add a partial too ^^
%(<label>test</label>)
end
You can find all available hook here.

Related

Prestashop how to customize theme

I have bought leo_chopin theme (because client asked for it). My question is how to customize a theme from html/php/css editor and not from admin panel (it's too constricting). I wouldn't hardcode, but use hooks. This is the first time I'm using Prestashop and that style of programing... For example, where to call my own header.tpl, footer.tpl, content.tpl?
Thank you in advance for your help.
Go to your_site_folder/themes/leo_chopin/ and you will find header.tpl, footer.tpl.
You can modify these templates there or make a copy of a theme into another folder and modify it.
All content between header and footer depends on a page controller. All controllers for the front are in a folder your_site_folder/controllers/front/. ProductController.php is for product pages, CategoryController.php is for category pages, IndexController.php is for the home page etc.
You can find more in Prestashop documentation: http://doc.prestashop.com/display/PS16/Laying+the+Theme's+Foundations.

How to customize the page?

I'm attempting to customize the Piranha CMS system. I'm interested in changing the layout, setting up my own styled menu and tweaking where the content on the page shows up.
Is the intent that I modify the _Layout.cshtml file to my liking?
If there's a page in the documentation that covers this, please helpfully provide the link. :)
Piranha CMS is just a framework for content management, not a website template with widgets, themes and stuff like that :) With that said, a basic Piranha CMS project is basically a standard MVC project with two included controllers, one that loads the model for a requested page, and one that loads the model for a requested post.
This means you can do anything that you can do with any normal MVC application when it comes to styling and modification.
There exists some helpers for rendering Menus, Breadcrumbs and so on. Documentation for the helpers can found here:
http://piranhacms.org/docs/api-reference/site-helper
http://piranhacms.org/docs/api-reference/ui-helper
For the helper methods that render html there are hooks for overriding all content rendered so that you can change the standard menu to your own style of html if you need. Documentation for the hooks available can be found here:
http://piranhacms.org/docs/api-reference/hooks
Regarding what can be achieved with Page types and creating templates with different regions you can check the following pages:
http://piranhacms.org/docs/pages/page-types
http://piranhacms.org/docs/pages/page-model
http://piranhacms.org/docs/pages/regions
http://piranhacms.org/docs/extend/extensions
I hope this helps you a bit.
Regards!
Håkan

Yii framework module layout issue

I am creating my first framework based project using YII framework. I have a main site and a module based backend to manage the site(CMS). First I used the same layout for both ends, but now I want two different layouts for front end and backend. I changed my module layout by adding a layouts folder to the module view file and I added “$controller->layout = 'main';” to the base module file of my module folder. Now the layout has been changed but when I logged in as a admin to the backend I cannot view any admin controller action, it means I am just a guest user. This issue is solved when I change my layout to the main site layout.
Please let me know if there is anything to do for this?
if the backend and frontend you created like module I think this will help:
$this->layoutPath = Yii::getPathOfAlias('(application.views.layouts or path/to/layouts)');
and in controllers of module just pasting layout name:
public $layout = 'login';

Is it good to duplicate the opencart module?

Well I want to make a custom page in opencart admin panel to insert and delete some data from opencart database
For example :
Set an image slider on opencart home page and fetching images from database & for insertion of images, I want to create a custom page in opencart admin panel ??
So how can it be possible ??
You can duplicate any module and create other for your needs. Remember to duplicate and change the filename so the "new" extension can work properly.
Folder to consider for admin:
admin->controller->{type of module}->module's name
admin->model->(type of module)->module's name
admin->language->english (always)->(type of module)->module's name
optional:
admin->language->(other languages)->(type of module)->module's name
you may try,
1,Login as Admin-> systems -> design ->banners -> insert ->
YOUR BANNER NAME-> add banner ->
Title: YOUR TITLE
Image: YOUR IMAGE -> Save
2, Login as Admin-> extensions -> Modules ->Slideshow -> Edit -> add Module -> SELECT YOUR BANNER -> Save
Also when duplicating modules be aware that you may also need to change the existing class name to different one. For example when duplicating module flat rate you will also need to change in the controller /admin/controller/shipping/flat.php :
class ControllerShippingFlat extends Controller {
to something new like :
class ControllerShippingFlatDuplicate extends Controller {
It's posible, but in my opinion if you want to create a new "admin page" in your Opencart you can do it using vqmod.
so, you don't have to rewrite any core file.
you can donwload any free extension on the opencart website to take an example
You can simply duplicate some simple modules available in opencart admin panel like Welcome module or Banner or Slideshow module.
This method will help you to disable the module or change the position of content in future.
Duplicating opencart module tutorial : http://opencart.hostjars.com/blog/58
As a beginner it's better to duplicate an existing module and modifying it as per requirement. When you get the idea of how opencart modules work, you can build modules from scratch.
Yes, it is pretty safe and sound to duplicate a module in opencart and it is a bit logical with any of the cms as no one is going to create a module from scratch for a very little functionality like inserting some values to database.
As depicts you just want to insert some images links, so you can proceed with replicating the catalog / information functionality in opencart admin panel.
You just need to create a new table in database to store new modules data and fetching new module data in front end.
If you want to create a custom module or custom page for your store you can check below link. There is complete solutions for your question and describe very deeply.
Create custom module: http://www.php-dev-zone.com/2015/02/opencart-custom-module-development.html

Rails : Can I use forms from the public/index.html file?

Am currently using Rails 3.0 to develop my app.
How to handle a form in the public/index.html file which I'm planning to use as my Home page.
Usually a view's action buttons gets paired with the corresponding method of its controller.
But how to handle this in case the index file in public directory?
This is possible, so long as the form's action attribute is pointing at an action of a Rails controller. However, it is not the norm in Rails to use a static HTML page to capture data. The norm is to use the MVC architecture of Rails.
I have to ask: Have you read the documentation provided on the Ruby on Rails website? Check out http://edgeguides.rubyonrails.org and read the Getting Started section.
Now, I think you might be using public/index.html because you don't know how to use a controller to serve the root of your website. Here's a quick example of how to use a controller instead of public/index.html:
Create a controller (i.e., home via rails g controller Home index)
Modify routes.rb and add root :to=>"home#index"
Delete public/index.html
The above is actually in the Edge Guides, Getting Stated section. So again, I strongly recommend you read the documentation. It will honestly save you a lot of trouble.