html <a name=" to define page
[Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]
Hi, I do not have an html txt editor, and I would like to put html on the define pages, if I put
<a name="name-element"> </a>
<a href="#name-element"> click paragraph </a>
I hit home page and not in the paragraph. </ strong> br etc works well, but a name not.
Re: html <a name=" to define page
At moments I think I fully understand the arrangement you have tried describe, but then I think about it and lose it.
If you have a series of words or a sentence that you want visitors to click on with the expectation that they be directed to somewhere else (on page or away), then the click on words/phrase should be an "a" link but the destination location would likely be a div, span, etc... The way the issue is presented looks like an "a" link is used to go to another "a" link...
Regardless, a little research indicated that at least with html5 (not sure if site is built with that in mind) that the id parameter should be used instead of the name parameter. In keeping with html validation and appropriate use, the id parameter value used should be unique for the page. (only one occurrence of say id="goto-big-text-block")
Re: html <a name=" to define page
MC is correct. The HTML5 way of doing this is
Code:
<span id="some-search-string"></span>
Then you can use the URL
http://some-url#some-search-string
and get to that point in the document.
Re: html <a name=" to define page
Hi, what I want to do is go to a place on the same page, as we do with the top of the page. I try this too but it does not work.
this will have to go into the part of the same page
<a href="#A1">1bla bla bla</a>
<a id="A1"></a>2blablabla</strong>
Re: html <a name=" to define page
I found I had to use the complete relative url.
eg:
index.php?main_page=product_info&cPath=1_2176&products_id=3711#A1
Re: html <a name=" to define page
sorry, I can not translate my thoughts, here what I want to do.
https://www.w3.org/TR/html4/struct/links.html
Thus, for example, an author might create a table of contents whose entries link to header elements H2, H3, etc., in the same document. Using the A element to create destination anchors, we would write:
<H1>Table of Contents</H1>
<P><A href="#section1">Introduction</A><BR>
<A href="#section2">Some background</A><BR>
<A href="#section2.1">On a more personal note</A><BR>
...the rest of the table of contents...
...the document body...
<H2><A name="section1">Introduction</A></H2>
...section 1...
<H2><A name="section2">Some background</A></H2>
...section 2...
<H3><A name="section2.1">On a more personal note</A></H3>
...section 2.1...
We may achieve the same effect by making the header elements themselves the anchors:
<H1>Table of Contents</H1>
<P><A href="#section1">Introduction</A><BR>
<A href="#section2">Some background</A><BR>
<A href="#section2.1">On a more personal note</A><BR>
...the rest of the table of contents...
...the document body...
<H2 id="section1">Introduction</H2>
...section 1...
<H2 id="section2">Some background</H2>
...section 2...
<H3 id="section2.1">On a more personal note</H3>
...section 2.1...
Re: html <a name=" to define page
Quote:
sorry, I can not translate my thoughts, here what I want to do.
https://www.w3.org/TR/html4/struct/links.html
Thus, for example, an author might create a table of contents whose entries link to header elements H2, H3, etc., in the same document. Using the A element to create destination anchors, we would write:
I think we understand your thoughts.
Quote:
Originally Posted by
torvista
I found I had to use the complete relative url.
eg:
index.php?main_page=product_info&cPath=1_2176&products_id=3711#A1
This is how I do it. Have you tried changing your <P><A href="#section1">Introduction</A><BR> to include the complete relative url - as Torvista suggested?
Re: html <a name=" to define page
I do not have to go to another page, I have to stay on the same page a little further down the page.
for example by clicking on <P> <A href="#section1"> Introduction </A> <BR>
I must go lower in the same page a
<H2 id = "section1"> Introduction </ H2>
Re: html <a name=" to define page
The code suggested does not need to take you to another page.
It would help if you can give the url of the page where you wish to add this html. You can rename the domain name if you wish.
Re: html <a name=" to define page
sorry friends, but i really can't make myself understood, i found an example, see this page
http://www.tagindex.net/html/link/an...le1s.html#a001
and click on
Jump to a001
Jump to a002
Jump to a003
You'll see that it goes up
a001
a002
a003
But always on the same page
it's what I want to do, I've done it many times on other cms but, on zen cart it doesn't work goes into. home page
ok I understood their code and it works
<h3><a name="menu">Menu</a></h3>
<ul>
<li><a href="#a001">Jump to a001</a></li>
<li><a href="#a002">Jump to a002</a></li>
<li><a href="#a003">Jump to a003</a></li>
</ul>
<h3><a name="a001">a001</a></h3>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<h3><a name="a002">a002</a></h3>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<h3><a name="a003">a003</a></h3>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<p>paragraph text paragraph text paragraph text</p>
<hr>
Re: html <a name=" to define page
ok, the problem is that it doesn't work with the extra page editor, like delfine page 4, but with the page at the end of the main page the code works fine. I need to put it in the final page 4 by chance I did a test in the main page and does it work like never?
Re: html <a name=" to define page
Ok, few things. This is not a "Zen Cart" issue. We are talking about html on the page.
If the html is not right (perhaps doesn't pass validation) then it could cause things like this not to work. There has been a request to identify where this is being tried (ie. Web page) so that more specific assistance can be provided.
Re: html <a name=" to define page
hi, the code is right, but I do not know why it is not going with some delfine page, as I said if I put the code on the delfine main page it works fine, on delfine page 4, 3.2 it does not work not. You can do a test if you have a test site
Re: html <a name=" to define page
Quote:
Originally Posted by
diamond1
hi, the code is right, but I do not know why it is not going with some delfine page, as I said if I put the code on the delfine main page it works fine, on delfine page 4, 3.2 it does not work not. You can do a test if you have a test site
It's unfortunate that in trying to make yourself understood that the time needed to understand what others have suggested hasn't been taken nor have the requests to provide specific information been answered so that a specific solution could be provided.
So... looks like someone needs to provide basic html training on a topic that is basically outside the scope of Zen Cart specific issues though will provide a Zen Cart solution to make it possible to repeat this action anywhere on your site. Oh, and yes this is a bit of "tough love"...
So, an web page is located on the internet. Links that are provided on the page can be fully written (http :// domain / sub-directory / file ? parameters), can be relative to the protocol used to access the page ( // domain / sub-directory / file ? parameters) or relative to the base page (file ? parameters).
The link is generated from what is provided in the href content and if it is not a full link or one relative to the protocol method, then it will be relative to the base page.
If you look at the source code of whatever page you are on (ie. page_2) and look for base href, you will see that the link will look like http or https // domain / sub-folder /. (if there is no sub-folder then the link will end at the slash after domain.
Thus, with your href tag being something like: href="#sample1" the resulting "link" is http or https // domain / sub-folder / #sample1... Therefore, the browser will try to navigate to the page defined which is the root of the site and then from there try to go to the id/name defined which would try to be sample1 if it exists.
If, however, the link had all of the content to indicate to stay on the same page but reference an item on the page, then no departure from the current page would occur, the browser will show the new link location in the web page address and even the back button being pressed on the browser would modify the url.
So. If in your "define" you added:
Code:
href="<?php echo zen_href_link((!empty($_GET['main_page']) ? $_GET['main_page'] : FILENAME_DEFAULT), zen_get_all_get_params(array('main_page')), $request_type); ?>#sample1"
Then the link would be generated using the Zen Cart process for a page recognized/defined in Zen Cart, though it does also depend on the url having a main_page parameter on it. That last part is important in relation to the destination as if there is no main_page, then the home page will be used/loaded.
So, as previously suggested, need to add the path to the url of the catalog path, whether it is fully defined or just hard-coded to match the current path.
Because of the absence of specific information, others helped by showing what they did for their specific situation rather than guessing at what you were doing or wanted. Ie. They helped as far as you helped them help you. Again "tough love".
Re: html <a name=" to define page
Now it works I do not understand why I have to give it url href = "<? Php echo zen_href_link ((! Empty ($ _ GET ['main_page'])? $ _GET ['main_page']: FILENAME_DEFAULT), zen_get_all_get_params (array ( 'main_page')), $ request_type);?> # sample1 "
"Tough Love"
Thank you MC12345678
Resolved!