Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43261
Total Topics: 7519
Most Online Today: 297
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 291
Total: 291

Author Topic: Linking to store item page?  (Read 5990 times)

0 Members and 1 Guest are viewing this topic.

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Linking to store item page?
« on: October 28, 2012, 09:00:51 am »
I would like to create a link that jumps to a certain spot at this URL so the user does not have to scroll down the page.

http://appliancejunk.com/forums/index.php?action=store;sa=view;id=118

I know the code to use and have done it before on other SMF pages.

Code: [Select]
<a href="yourpage.html#yourNamedAnchor">TEXT HERE</a>
<a name="yourNamedAnchor"></a>

But I'm not sure just were to put the

Code: [Select]
<a name="yourNamedAnchor"></a>
I would like it so the dvd item I posted the link to above come up with the title already at the top of the page with the user having to scroll down.

Hope that make sense, thanks.


Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Linking to store item page?
« Reply #1 on: October 28, 2012, 03:53:49 pm »
Can be done it would be in the store2.template.php file in the view_item function

But where do you want it to jump I looked at your link do you want it by the buy now area?
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: Linking to store item page?
« Reply #2 on: October 28, 2012, 04:03:59 pm »
Would want it so the title of the item is at the top of the page, as shown in the attachment.

Thanks,

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Linking to store item page?
« Reply #3 on: October 28, 2012, 04:08:49 pm »
You would add in this code in store2.template.php
Around line 913
Code: [Select]
// Show the title of the product
  echo '<tr class="catbg">
<td align="center"><span itemprop="name">', $context['store_item']['productname'], '</span></td>
</tr>';
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: Linking to store item page?
« Reply #4 on: October 28, 2012, 04:17:24 pm »
That will make just this one item in our store jump to the title then?
http://appliancejunk.com/forums/index.php?action=store;sa=view;id=118

or all the store items would jump to the title?

I want it so just the one item jumps to the title, if that's what the code does I will just try it but I don't see how it would work on just the one store item.

thanks,

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Linking to store item page?
« Reply #5 on: October 28, 2012, 04:20:00 pm »
It would work with any item as long as you add the # to the link so you can choose to use it or not.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: Linking to store item page?
« Reply #6 on: October 28, 2012, 04:24:53 pm »
Ok, so I would just add the # to the end of my link like this.

http://appliancejunk.com/forums/index.php?action=store;sa=view;id=118#

For some reason I just can't get my head around how it work right now, sorry.

Thanks,

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Linking to store item page?
« Reply #7 on: October 28, 2012, 04:29:23 pm »
add this code in the php
Code: [Select]
<a name="itemtitle"></a>

Then in your link you would do
http://appliancejunk.com/forums/index.php?action=store;sa=view;id=118#itemtitle
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: Linking to store item page?
« Reply #8 on: October 28, 2012, 04:37:44 pm »
Ok, I understand what you are saying now and I feel really stupid, lol...

I thought you were telling me to add the code you posted to the store2.template.php around 913.

After looking at store2.template.php I see the code you posted is already there and you were telling me to add my link code not the code you posted.

ROFL, works great now.

http://appliancejunk.com/forums/index.php?action=store;sa=view;id=118#itemtitle

Thanks,

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Linking to store item page?
« Reply #9 on: October 28, 2012, 04:42:16 pm »
glad we got it working!
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
8356 Views
Last post May 15, 2008, 09:53:58 pm
by SMFHacks
0 Replies
4775 Views
Last post June 08, 2008, 10:01:34 pm
by ApplianceJunk
0 Replies
3975 Views
Last post September 25, 2008, 09:09:28 am
by Sweetwater
3 Replies
4152 Views
Last post March 23, 2018, 10:19:25 pm
by Michael Vail
4 Replies
947 Views
Last post August 17, 2021, 09:38:46 am
by SMFHacks

+- Recent Topics

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
Today at 08:27:36 am

No thumbnails on new uploads by Tonyvic
Today at 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Powered by EzPortal