Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 831225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:10:04+00:00 2026-05-15T04:10:04+00:00

on the site I’m working on, I need to show two different HTML snippets

  • 0

on the site I’m working on, I need to show two different HTML snippets depending if another element is activated or not.

Like:

{if "div class="box expandResults" is enabled(or appearing on the page)"}

....HTML....

{else}

....OTHER HTML....

{/if}

How can I do this with Smarty or jQuery? I only have access to the .tpl files.

Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:10:05+00:00Added an answer on May 15, 2026 at 4:10 am

    Do it with JavaScript. Generate following HTML:

    <div id="boxExpandResultsEnabled" style="visibility: hidden"> 
    ....HTML...
    </div>
    <div id="boxExpandResultDisabled" style="visibility: hidden"> 
    ....OTHER HTML....
    </div>
    

    JavaScript for Prototype would be:

    <script>
            if($$('div.box expandResult')) {
                $('boxExpandResultsEnabled').show();
            } else {
                $('boxExpandResultsDisabled').show();
            };
    </script>
    

    Same thing for JQuery:

    <script>
            if($('div.box.expandResult')) {
                $('#boxExpandResultsEnabled').show();
            } else {
                $('#boxExpandResultsDisabled').show();
            };
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My site has three columns. I have two fields within a form that need
Site: http://clientfiles.priworks.com/lgmanagedportfolios/test/investment.html I have been working at this web page for a while now
Site here . Why is it that the code works for $('#club').change(function(event) but not
The site I'm currently working on has a series of videos on a carousel
My site : jQuery Animation (`comsat.js`: `showPlayerActionView()`): if (container == cs_characterSliderPlayerOne){ container.show(slide, {direction: left},
Site's at http://cocktail.juggernautwebsites.com/ and I'm working in the footer. I'm trying to scroll the
My site is running under IIS correctly. But after working for long time. It
The site was working properly but after I modified a code file. the site
Site: http://sebastiano.freehostia.com/ CSS: /style.css I'm not overly sure what's going wrong with the positioning
Site: is here picture html: <img alt= src=UserFiles/Image/galerie/12970854473D-Eco-60.jpg> when I add border: 2px solid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.