Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12207
Latest: luisda3
New This Month: 15
New This Week: 7
New Today: 0
Stats
Total Posts: 39216
Total Topics: 6904
Most Online Today: 166
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 123
Total: 123

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

0 Members and 1 Guest are viewing this topic.

Offline ApplianceJunk

  • Downloads Pro Customer
  • 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: 14634
    • 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

  • Downloads Pro Customer
  • 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: 14634
    • 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

  • Downloads Pro Customer
  • 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: 14634
    • 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

  • Downloads Pro Customer
  • 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: 14634
    • 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

  • Downloads Pro Customer
  • 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: 14634
    • 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
5797 Views
Last post May 15, 2008, 09:53:58 pm
by SMFHacks
0 Replies
3348 Views
Last post June 08, 2008, 10:01:34 pm
by ApplianceJunk
0 Replies
2856 Views
Last post September 25, 2008, 09:09:28 am
by Sweetwater
3 Replies
3901 Views
Last post September 28, 2009, 10:45:31 pm
by Vincent Volmer
3 Replies
549 Views
Last post March 23, 2018, 10:19:25 pm
by scso1502

+- Recent Topics

KARMA Badge by SMFHacks
October 17, 2018, 11:17:16 pm

Turn off Download Stats? by SMFHacks
October 17, 2018, 04:21:18 pm

multiple currencies bug by nonono12
October 17, 2018, 08:03:01 am

remove the boards ? by SMFHacks
October 16, 2018, 03:08:00 pm

Upgraded to pro - some features not working? by SMFHacks
October 16, 2018, 10:21:38 am

message editor pro by SMFHacks
October 15, 2018, 06:19:38 pm

SMF lottery mod by SMFHacks
October 13, 2018, 08:02:41 am

Error after adding Russian translation by SMFHacks
October 08, 2018, 04:10:41 pm

Adseller Pro 3.0 Released! by SMFHacks
October 06, 2018, 05:45:42 pm

problems with my GDRP pro and my SMF forum. by SMFHacks
October 03, 2018, 03:42:57 pm

Powered by EzPortal