Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12240
Latest: ptrcmres01
New This Month: 9
New This Week: 5
New Today: 1
Stats
Total Posts: 39383
Total Topics: 6933
Most Online Today: 41
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 38
Total: 38

Author Topic: Linking to store item page?  (Read 3906 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: 14715
    • 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: 14715
    • 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: 14715
    • 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: 14715
    • 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: 14715
    • 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
5837 Views
Last post May 15, 2008, 09:53:58 pm
by SMFHacks
0 Replies
3365 Views
Last post June 08, 2008, 10:01:34 pm
by ApplianceJunk
0 Replies
2872 Views
Last post September 25, 2008, 09:09:28 am
by Sweetwater
3 Replies
3919 Views
Last post September 28, 2009, 10:45:31 pm
by Vincent Volmer
3 Replies
632 Views
Last post March 23, 2018, 10:19:25 pm
by scso1502

+- Recent Topics

condition de livraison by SMFHacks
December 14, 2018, 12:47:53 pm

Multiple Versions in SMF by Boomslanger
December 13, 2018, 06:13:31 pm

GDPR Helper free doubts by Rock Lee
December 08, 2018, 06:20:57 pm

Downloads Pro 5.0 Released by SMFHacks
December 05, 2018, 03:11:32 pm

SMF Hacks Black Friday Sale! by SMFHacks
November 30, 2018, 09:03:04 am

Rewrite rule for IPN by diegolyanky
November 26, 2018, 10:58:55 am

EDITOR PRO by SMFHacks
November 25, 2018, 03:12:19 pm

SMF Gallery Pro 8.0 / PHP 7.0 onwards by SMFHacks
November 25, 2018, 12:33:10 pm

5.0 beta log errors by tfs
November 24, 2018, 10:37:06 pm

Download button doesn't initiate a download the first time by SMFHacks
November 24, 2018, 09:08:55 pm

Powered by EzPortal