adding custom page's link in homepage in opencart - opencart

I am new in opencart, and I am trying to build a new eCommerce site using opencart where I need to add some custom static page ( some additional page ). So I follow the link New Page For OpenCart and opencart php custom page without using the "information" feature, and I can create a new custom page. But my problem is, how can I get this page's link on my home and others page so that people view my page.

If you are creating a new page that way, you will be to access the page (called "newpage" for example) at: /index.php?route=common/newpage or /index.php?route=common/home/newpage depending how you set it up.
The simplest way of creating a new page is to create a new information page. You can input your custom html there if needs be. The link would then look like:
/index.php?route=information/information&information_id=x where the id is the id of your new page.
To add this link into your main menu you can edit template/common/header.tpl and hardcode in the new link.

Creating your link would depend greatly on how the page has been created, and where it's located.
Urls are built based on the location ie: route of your controller.
Let's say your new page has been built in:
catalog/controller/common/mypage.php
Obviously you'll need to follow the code standards listed in the posts you referenced for created a correct class that extends the Controller, a language file, a model class (if your page needs to interact with the database) and a view file.
Once all that is correct via the previous posts you can create a link anywhere on the catalog (front) by calling the url class and passing in the required information.
You'll need to pass in a route, any arguments such as an id or customer, and whether the url should be secure.
$link = $this->url->link('common/mypage', 'mypage_id=' . $this->request->get['mypage_id'], 'SSL');
$arguments and 'SSL' being optional if they're needed.

Related

Solution To create or update static pages in Django

How can I create interface or solution to the website owner to be able to create or update static pages in Django without open source code, for example, a website owner needs to update text in aboutus page or want to create a new static page like new promotion details.
If I understood you correctly you want to allow user to update the text or add new page dynamically. If so you can go for Django content management system you can use django mezzanine. https://www.digitalocean.com/community/tutorials/how-to-install-and-get-started-with-django-based-mezzanine-cms-on-ubuntu

Button to create new page

I'm new to Mezzanine and django, in this moment I'm trying to make a button in a page template, the idea is to allow the registered user to do two things:
create a new daughter page of the current page
add an access link to a list of links of the current page
I would like to make a popup appear that asks for the name and content of the new page, I do not know if what I need is very complex to do with mezzanine, I study the djangogirls tutorial (tutorial.djangogirls.org) and I reviewed the examples of the mezzanine documentation (mezzanine.jupo.org/docs/content-architecture.html), but I do not see how to do what I need, this is the link for my mezzanine project: github.com/Dacastror/inicio_mezzanine
in advance I appreciate the help.

Sitecore: Create component and insert into placeholder on page creation

We have developed a Sitecore site for a client who will primarily be using Page Editor. We've built page type layouts and then componentized everything else, including sub-layouts of content. This allows them the most flexibility when building pages.
So, an author goes to a page selects the main content area (Placeholder) of the page and inserts basic building block components that we've created. These include Rich Text box, page promos, etc. they can use these to build pretty rich pages with lengthy content.
All page components have the same Datasource Location, which is a "Page Components" folder that's setup as an item bucket.
This is all working well so far.
Now, I'm trying to make it so when a page is created a specific component is created, inserted into to our "Page Components" bucket and placed in a specific placeholder on the page.
I've been trying to build a Branch Template to accomplish this, but I don't see how to specify that the new component should be stored in our bucket location, instead of directly underneath the Page item. Also, how to make the component show up in the placeholder that I want on the page.
Is this possible? Thanks in advance for you help!
You will want to use a command template for this, since you are desiring to programmatically bypass Sitecore's standard layout configurations and branch template creation.
On your page template standard values, you will want to add the sublayout to the presentation details so you can hook the datasource in programmatically after creation.
The fundamental flow in the command will be as follows:
Create the desired page item
Create the desired component datasource in the bucket location
Search the layout definition of the created page item to find the appropriate sublayout to bind to.
Alter the datasource on the sublayout to bind to the datasource you created.
As #jammykam mentioned, there is a recent blog post now available.

How to create a landing page with OpenCart, using OpenCart only?

What if one would want to create a landing page/home page for opencart?
How does someone will supposed to do that?
A landing page or home page, using only opencart and no other means.
--
Clarification.
What I meant of Home Page is it's literal meaning in the context of Front-End WebDev. What I meant to say is, the page where user is redirected when they access my site's root domain.
I want to design and create a custom landing and home page. That landing page has no product content.
It shall only contain the folowing;
Main Navigation Menu with, Home, Online Shop, Blog links.
Site Name, Site Logo
Site Name with Tagline.
Banner Rotator with CTA button.
Footer, Footer Links to Privacy Policy, About Us and other common footer links.
This Home Page/Landing Page/Index Page, is a different page from the main store section. On this page, It has a home page link and a store page link. So on the main nav of this page, you shall see a Home link and a Store link. Clicking store link, shall take you to the main store section and the main nav shall show the categories, the store has.
To achieve what You are requesting:
It shall only contain the folowing:
 1. Main Navigation Menu with, Home, Online Shop, Blog links.
 2. Site Name, Site Logo
 3. Site Name with Tagline.
 4. Banner Rotator with CTA button.
 5. Footer, Footer Links to Privacy Policy, About Us and other common footer links.
You would have to disable any module that is displaying on homepage (categories, featured, bestsellers, latest, specials, etc.) and enable only the carousel module (or install one of Your desire) and place it on the Content Top position.
In that case You would have these elements:
header (with site name, logo, main navigation)
Your desired carousel/banner rotator
footer (with additional links)
Is that what You are requesting?
Edit 1: I think the homepage You request is kinda nonsense... Why on earth You would like to have a homepage with a link to homepage and store? I would understand to have a website (presentation) with a blog and store that both run within u subdirectory, thus having a site www.site.com, with a blog at www.site.com/blog/ and a store at www.site.com/store/. In that case I would understand that within the main site (www.site.com) You would have a homepage with link to /blog/ and to /store/.
BUT if You are running only a store at Your domain (www.site.com) then having additional homepage is nonsense, as You could create a homepage described above (header + text and carousel as content + footer)...
Edit 2:
Yes, that's my main idea mydomain.com would be my landing page/index page/home page. mytdomain.com/store, is the store section and also with the blog section at mydomain.com/blog.
In that case You could create just a simple static HTML page that will contain static text and a javascript carousel (banner rotator/slider). After You have installed the blog and store to their subdirectories then just create a link to both of them within Your static homepage that lays in the root of the web folder and is called index.html.
Another way how to achieve this with slightly more effort is to have the desired blogging system installed in the root, editing it's homepage while having the main blog on a subpage and a store within a subdirectory. Many people run wordpress/drupal installation at www.site.com and an OpenCart installation at www.site.com/store/. Within a wordpress site You can then have a subpage /blog/ where You will post all of Your blog posts...
So is this the final solution?
The reason why someone would want to do that is for marketing purposes. Creating unique content is extremely important for SEO. The opencart default page does not have much area for landing pages or gateway pages. You may have to improvise to achieve this.
What I would recommend is just create your landing page and then use .htaccess file in /public_html folder to use whatever page you created, inside the landing page code use href links that take you to the products. This would be your best bet.

Reload googlemaps after user clicks a link in Django

I am doing a project in Django and i want to have some google maps displayed in my site. So, i installed django-easy-maps and successfully used it in a sample template. So, i am ready with my maps.
The interface i want to implement is this
http://i49.tinypic.com/sowm74.png
I want to display the maps where the Hellow World! container is and with different links on the sidebar i want to refresh the map being displayed on user click without reloading the page.
I did some researching and it seems Ajax is the solution...
Can anybody tell me how i might achieve this (with or without Ajax ) ?
Sorry for sounding like a noob but i am fairly new to this.
The basic steps are:
Create a view for the Google Maps section to the right. This view does not return a full HTML page but only the HTML for that section (which contains your Google Maps map).
When the user clicks on a link on the left, use JavaScript to perform an ajax call to request that page. In short this means: attach an event handler to the onclick event of those links and in code you can perform an ajax call .Many people use a JavaScript library for this purpose, such as jQuery (which has $.ajax()).
You can then use JavaScript to put the received HTML inside the container on the right (using $.html()).