1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Search Links

Discussion in 'XenForo Questions and Support' started by SurferJon, Dec 1, 2014.

  1. SurferJon

    SurferJon Member

    Hi, I was wondering if it's possible to create automated links to searches.

    On my forums, people sell trading cards in a specific sub-forum. They use a standard format in their posts to list what cards they have. And on my website's front page, I have scans of every possible card. When someone looks at a scan, I want to have a link they can click to run the search for that card to see who has it on the forums. To compile the link, I would just use the card name from the database and edit that into the link so that there is a search link to XF.

    So let's say a forum user lists they have a "ABC Baseball Card" in their thread, which is in X forum (let's say node 25). On my front page, could I have some sort of automated link like this, which I could edit for any card?
    https://xenforo.com/community/search/6118366/?q=ABC Baseball Card&t=post&o=date&c[node]=25

    The problem now is that it seems I can't really make automated links because each search result has a unique ID. So is there some way to be able to make automated links that will run when someone clicks them and which can be customized for any search term to run a new search for that item?

    Thank you!
     
  2. AndyB

    AndyB Well-Known Member

  3. Brogan

    Brogan XenForo Moderator Staff Member

    That isn't necessary.

    See this post for how to construct custom search URLs: https://xenforo.com/community/threa...ndex-of-threads-by-authors.65080/#post-686608

    If adding a link to a template, you can do something like this:
    Code:
    <a href="{xen:link 'search/search', '', 'users={$visitor.username}', 'type={xen:array "post={xen:array 'thread_id={$thread.thread_id}'}"}'}">...</a>
     
  4. Mike

    Mike XenForo Developer Staff Member

  5. AndyB

    AndyB Well-Known Member

    If I understand correctly, if I want to create a link (which is not a user specific search) adding a "1" is the only way to do this? Is this correct?
     
  6. Jeremy

    Jeremy XenForo Moderator Staff Member

    You are not correct.
     

Share This Page