How insert Widget only in Home Page?

Discussion in '[bd] Widget Framework' started by anto74, Feb 28, 2014.

  1. anto74

    anto74 Member

    Hi @xfrocks
    my index/home page is [bd] Widget Framework Widget page set as Index page.
    I would insert one widget only in home page ( sidebar position): what expression i can use?
    Thanks :)
    Antonio
     
  2. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    For Widget Page, you don't need to care about position. Click the "Add Sidebar Widget" link when you edit the Widget Page.
     
    anto74 likes this.
    1. anto74

      anto74 Member

      anto74 @xfrocks Ohhhhh...it's true!!! :)
      Thanks :)
      Antonio
       
  3. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    You are welcome :)
     
    anto74 likes this.
  4. anto74

    anto74 Member

    Little problem...the widget is below other sidebar widget created in List widget ( not in Widget page)
    How can i shows my sidebar widget at first position and bypass other widget?
     
  5. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    You meant widgets configured with "all" position?
     
  6. anto74

    anto74 Member

    Yes, the other widgets, configured in List widget ( not in Add sidebar widget in Index page), are in all position.
    The first widget in "all"position is at -800
    My widget in Index Widget page is -900 but it shows at end in sidebar
     
  7. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    Normally widget in page is rendered above "all"-position widget. You can try negative display order. But this is a weak point of the add-on.
     
  8. anto74

    anto74 Member

    yes, i have used negative order -900
    I can solve the problem if exist expression for show the widget only in widget page but adding widget in List Widget page and not in Add sidebar widget in Index widget page...
     
  9. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    Well, if it is the case. You can use "all" position and this expression

    PHP:
    !empty($widgetPage) AND $widgetPage['node_id'] == 1
    Replace 1 with your node ID.
     
    1. anto74

      anto74 Member

      anto74 @xfrocks Now it's perfect! :)
      Thanks!
      Antonio
       
      xfrocks likes this.
      1
  10. anto74

    anto74 Member

    Hi @xfrocks
    why this expression
    Code:
    !empty($widgetPage) AND $widgetPage['node_id'] == 1
    not works with [bd] Image widget? The widget not shows if i insert this expression and position hook:ad_above_top_breadcrumb

    Antonio
     
  11. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    That expression doesn't work at that position.
     
    anto74 likes this.
    1. anto74

      anto74 Member

      anto74 @xfrocks Ah, ok :)
      For this position there is an expression that works? :)
       
  12. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    What go you need?
     
    1. anto74

      anto74 Member

      anto74 @xfrocks I would show the widget [bd]Image only in home page in hook:ad_above_top_breadcrumb. My home page is [bd] Widget page as Index.
       
  13. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    Ah, that is a bit tricky. Can I have link to your site (where the widget page is index)?
     
  14. anto74

    anto74 Member

  15. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    You can use this expression

    PHP:
    $bodyClasses == 'node439'
     
    anto74 likes this.
    1. anto74

      anto74 Member

      anto74 @xfrocks Thanks,it Works Perfect! :)
       
      xfrocks likes this.
      1
Loading...