Jump to content

Need Help Adjusting Custom Documents Drop Down


Dirty Butter

Recommended Posts

I use SFWS's Deluxe Document Manager for the website Documents and am very pleased with it. I did, however, get SemperFi a long time ago to help me create a drop down system for the Documents on small screens. When CC changed a lot of code sometime back to split things into elements, etc - I had to take what SFWS had provided that worked perfectly and try to adjust it. Well, it's never been a perfect fix. But I now realize that something like 80% of our business is from mobile devices. SO I really need to fix this.

I have a couple of Documents that are correctly hidden on the wide screen, unless an action or snippet allows them to show.

But I can't figure out how to keep those two documents from showing in the list when viewed from a small screen.

Here is my attempt to create the small screen drop down directory:

{*
 * CubeCart v6
 * ========================================
 * CubeCart is a registered trade mark of CubeCart Limited
 * Copyright CubeCart Limited 2017. All rights reserved.
 * UK Private Limited Company No. 5323904
 * ========================================
 * Web:   http://www.cubecart.com
 * Email:  [email protected]
 * License:  GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
 *}
<nav class="top-bar category-nav" data-topbar="" id="box-navigation">
  <ul class="title-area">
     <li class="name"></li>
     <li class="toggle-topbar left"><a href="">{$LANG.documents.title_documents}<svg class="icon"><use xlink:href="#icon-caret-down"></use></svg></a></li>
  </ul>  
  <section class="top-bar-section">
     <h5 class="hide">{$LANG.documents.title_documents}</h5>
     <ul class="left">
		<li><a href="{$ROOT_PATH}" title="{$LANG.common.home}"><svg class="icon"><use xlink:href="#icon-home"></use></svg>{$LANG.common.home}</a></li>
		{if isset($DOCUMENTS) && count($DOCUMENTS) > 0}
         {foreach from=$DOCUMENTS item=document}
         <li><a href="{$document.doc_url}" title="{$document.doc_name}">{$document.doc_name}</a></li>
         {/foreach}
         {/if}
         {if isset($CONTACT_URL)}
         <li><a href="{$CONTACT_URL}" title="{$LANG.documents.document_contact}">{$LANG.documents.document_contact}</a></li>
         {/if}
         {foreach from=$DOCUMENTS_LIST_HOOKS item=list_item}
         <li><a href="{$list_item.href}" title="{$list_item.title}">{$list_item.title}</a></li>
         {/foreach}         
     </ul>
  </section>
</nav>
<br style="clear: both;" />

And here's a screenshot of the result. Note the Thankyou Discount and Sorry, Your Search Was Not Successful titles should not be showing. They do not show on the full screen view.

1867058111_Screenshot_2019-11-27PlushMemoriesLovieShoppe.thumb.png.a74f9b6f53a638aa54b26af2ff85ebe7.png

Any suggestion for some way to keep those two Documents from showing on phones? The Thank You Discount is the page PayPal sends the customer back to after payment. And Bsmither created the Search help document that uses a snippet to trigger it.

Link to comment
Share on other sites

There is one area that is wrapped in a 'hide-for-small' class. This is loaded with a contiguous series of what appears to be hard-coded links.

There is another area that is wrapped in a "hide-for-medium-up" class. But this area appears to be the stock <nav> bar and top-bar <section> (for documents), followed by a second <nav> bar and top-bar section (for categories).

So, the question is, is the HTML in the "hide-for-small" area populated by custom code that allows the admin to specifically list URLs (as evidenced by a facebook link)? If so, then perhaps it does not honor the document's setting of "Show link in storefront" checkbox.

And if that is so, then perhaps you can experiment with checking this box so that the skin can test for this setting.

Link to comment
Share on other sites

I think you are right about not honoring the "show link in storefront". Stock admin Document has a box to show or not show. The more I think about it, I think I'm going to have to edit some SFWS code somehow so my accordion.php file calls a SFWS document position. I have 4 choices - Header, Footer, Side 1, Side 2. I'll see if I can get the Side 1 to work somehow.

Link to comment
Share on other sites

I figured it out! It dawned on me why it was not observing the "hide" choice. I renamed the code in my accordion.php to use document naming from the SFWS header file already being used, so active in hooks:

<ul class="left">
		<li><a href="{$ROOT_PATH}" title="{$LANG.common.home}"><svg class="icon"><use xlink:href="#icon-home"></use></svg>{$LANG.common.home}</a></li>
		{if isset($HEADER_DOCUMENTS) && count($HEADER_DOCUMENTS) > 0}

         {foreach from=$HEADER_DOCUMENTS item=header_document}
         <li><a href="{$header_document.doc_url}" title="{$header_document.doc_name}" {if $header_document.doc_url_openin}target="_blank"{/if}>{$header_document.doc_name}</a></li>
         {/foreach}
         {/if}
         {if isset($CONTACT_URL)}
         <li><a href="{$CONTACT_URL}" title="{$LANG.documents.document_contact}">{$LANG.documents.document_contact}</a></li>
         {/if}
         {foreach from=$HEADER_DOCUMENTS_LIST_HOOKS item=list_item}
	 <li><a href="{$list_item.href}" title="{$list_item.title}">{$list_item.title}</a></li>
	 {/foreach}         
     </ul>

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...