Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12172
Latest: LeaMoeller
New This Month: 14
New This Week: 1
New Today: 1
Stats
Total Posts: 39049
Total Topics: 6874
Most Online Today: 59
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 27
Total: 28

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

+- Recent Topics

link for users gallery from profile page by SMFHacks
August 20, 2018, 02:40:58 pm

[Mod]Tidy Child Boards 2.0 by SMFHacks
August 20, 2018, 01:32:43 pm

Admin View in Member's Profile of Dates for Accepting of PP and Reg Agreement by SMFHacks
August 18, 2018, 12:03:07 pm

Gallery2 Template Loading Error by SMFHacks
August 18, 2018, 12:02:12 pm

8: Undefined index: description by SMFHacks
August 17, 2018, 01:42:08 pm

It just does not send by SMFHacks
August 16, 2018, 11:03:06 pm

Ad beginning of post by SMFHacks
August 16, 2018, 10:22:58 pm

Agreement Date says NEVER by SMFHacks
August 14, 2018, 04:46:48 pm

HashTags system for SMF 2.0 released by Diego Andrés
August 12, 2018, 02:04:24 pm

Can the Store produce a unique code that you can sell? by SMFHacks
August 11, 2018, 11:43:32 am

Powered by EzPortal