XenZine Articles [Deleted]

The code of the article-list is honestly driving me crazy. I see a lot of redundancy, unnecessary elements and hard to modify classes. I have thought about it for some time but I just cannot think about any reason why it has to be built like this. I think it would work much simpler than the code right now. Maybe you can help me and explain, why things have to be like this.

Let's give an example. I will take one of your articles from the surrey forum to serve as example. The code is given as the following:
HTML:
<div class="box_a masonry-brick" style="position: absolute; top: 0px; left: 500px;">
    <div class="styledBox">
   
        <div class="titleAndImage">
            <a href="xz-articles/surrey-events-plan-your-surrey-event-part-1.23/">
            <div class="hoverMask"></div>
       
            </a><div class="crop"><a href="xz-articles/surrey-events-plan-your-surrey-event-part-1.23/">
                   
                </a><a href="xz-articles/surrey-events-plan-your-surrey-event-part-1.23/" class="artImg">
                   
                        <img src="http://www.surreyforum.co.uk/data/article_images/l/0/23.jpg?t=1371508074" align="absmiddle" class="srcimg">
                    </a>
            </div>
       
       
       
            <div class="titleContent pinTitleRow">
                <h3>Surrey Events: Plan your Surrey Event - Part 1</h3>
            </div>   
                   
        </div>
       
        <div class="imgContent">
       
            <div class="ratingContent pinRow">   
               
                <div class="ratelist">
                    <form action="xz-articles/surrey-events-plan-your-surrey-event-part-1.23/rate-article-dialogue" method="post" class="rating RatingWidget">
                        <dl>
                            <dt class=""></dt>
                            <dd>
                               

    <span class="star Full"></span>
    <span class="star Full"></span>
    <span class="star Full"></span>
    <span class="star Full"></span>
    <span class="star Full"></span>


   




                            </dd>
                        </dl>           
                        <input type="hidden" name="_xfToken" value="">
                    </form>
                </div>
               

                    <span class="reviewCount pinMute">
                        <a href="xz-articles/surrey-events-plan-your-surrey-event-part-1.23/reviews"> 1 Reviews</a>
                    </span>
                           
            </div>   
           
            <div class="pinRow pinMute authorContent">
                <a href="members/surrey-events.507/" class="avatar Av507s" data-avatarhtml="true"><img src="http://www.surreyforum.co.uk/data/avatars/s/0/507.jpg?1334865380" width="48" height="48" alt="Surrey Events"></a>
                Article Author 
                <div class="userTitle"><a href="members/surrey-events.507/" class="username">Surrey Events</a></div>
                <div class="spacer" style="clear: both;"></div>
            </div>   
           
            <div class="pinRow aboutContent">
               
                <span class="articleMore pinMute">
                    <a class="imgMore" href="xz-articles/surrey-events-plan-your-surrey-event-part-1.23/" id="23_more">Article Summary</a>
                    <a class="imgLess" href="xz-articles/surrey-events-plan-your-surrey-event-part-1.23/" id="23_less">Less</a>
                </span>
            </div>           


            <div class="pinRow articleSum" id="articleSum_23">
                <p>Things to Do Before Planning an Event in Surrey

* Think careful about the date, you wouldn't want to start planning an event when it clashes with something else. Check your local tourist information centre, look at several local event lists and even check your TV guide (a big sports event on TV can certainly dwindle numbers)</p>
                <div class="posterDate muted">
                    Article by <a href="members/surrey-events.507/" class="username postDate" title="Article Author">Surrey Events</a>,
                    <span class="faint"><span class="DateTime" title="18 Jun 2013 at 12:52 AM">18 Jun 2013</span></span>
                </div> 
            </div>               
           
           
        </div>   
       
    </div>
</div>

To start with the most obvious thing: there are three links in total pointing to the article. I see one is wrapping the image and one is serving as a layer to simulate a hover effect, but I haven't found out, what the third one serves for.

However, you should remove the hover and do it with opacity or simualting a new element with css when hovering the link below. This should be possible by now with css3. It does not only remove redundant code but make things a lot easier to oversee.

Linked with this is the hoverMask-class-div. What exactly does this element serves for? You can put all the code necessary directly into the surrounding a-element.

Maybe you can explain me what the third link (the one in the middle) is good for, otherwise it may should be removed.

Next: There is a small border underneath every image. A border, that actually only exists in webkit browsers. But not only the fact it is missing in internet explorer, opera, ie and so on, but it is built out of an 1x1px image. What is this good for? Why don't you use the border-top property here and make the border visible in every web browser?

Next: Five spans for five stars? Why don't you make one span with the complete with of all five stars and give it the empty star as repetitive background. Then put another span on top of it with the repetitive image of the full star. Ajust the width as necessary.

You should also remove the titleContent pinTitleRow-class-div and put the code right into the h3-child of it. This will again remove an unnecessary element from the code.

This should be it for the first. Would be glad if you could explain me the reason for the things described above and maybe this criticism helps you, to make your addon even better ;)
 
I think the strange structure of links was from using the core helper (but also wanting to cover the titles and hovermask). An extra div for the hovermask was necessary, since it needed absolute positioning to cover both the title and the images (I didn't want to do this on the parent).

It's changed completely, I'm not looking back since I've redesigned this area and now use my owner helper the way I need to use it (with or without a hovermask with one link to wrap the entire block), there is also no longer a hovermask for article entities (since now on hovering over the images, an overlay is triggered)

I've updated SurreyForum, so latest html is rendered, if you want to critique the html, I would rather you did it with this version ;)
 
Last edited:
Yeah, I know... the title needs to be a link, it's not quite finished, I just wanted to add the latest html (so @katsulynx is not driven quite as crazy as they were before :) )

... the avatars are also not showing correctly on the SurreyForum version (but will before release ) ;)
 
Is there a variable to check if the article tab is active? I want to change the tabs in the tabLinks menu with a dropdown menu:

Submit Article Menu.webp

PHP:
<li class="Popup PopupControl">
    <a href="{xen:link full:xz-articles/submit-new-article}" class="secondnavLink">{xen:phrase xz_submit_an_article}</a>
 
        <a href="{xen:link full:xz-articles/submit-new-article}" class="secondnavArrow" rel="Menu"></a>
    
        <div class="Menu JsOnly tabMenu">
            <ul class="secondaryContent blockLinksList">
                <li><a href="{xen:link full:xz-articles/submit-new-article}">{xen:phrase xz_submit_an_article}</a></li>
                <li><a href="{xen:link full:xz-articles/published}">{xen:phrase xz_published}</a></li>
                <li><a href="{xen:link full:xz-articles/unpublished}">{xen:phrase xz_unpublished}</a></li>
            </ul>
        </div>
</li>

This is working, but the problem is, that the submenu is also visitble in the tab articles:
Articles Dropdown.webp

In the forums tab it's possible to disable the submenu with a query around the entrys of the dropdown menu, if the forums tab is selected (<xen:if is="{$tabs.forums.selected}">):
PHP:
<li class="Popup PopupControl">
    <a href="{xen:link members}" class="secondnavLink">{xen:phrase members}</a>

    <xen:if is="{$tabs.forums.selected}">
        <a href="{xen:link members}" class="secondnavArrow" rel="Menu"></a>
 
        <div class="Menu JsOnly tabMenu">
            <ul class="secondaryContent blockLinksList">
                <li><a href="{xen:link members}">{xen:phrase notable_members}</a></li>
                <li><a href="{xen:link members/list}">{xen:phrase registered_members}</a></li>
                <li><a href="{xen:link online}">{xen:phrase current_visitors}</a></li>
                <li><a href="{xen:link recent-activity}">{xen:phrase recent_activity}</a></li>
            </ul>
        </div>

    </xen:if>
</li>

<xen:if is="{$tabs.xz-atricles.selected}"> is not working in the article tab, is there a variable to check if this tab is active?
 
I wont use these drop downs in XenZine, since they don't play well with responsive design, but feel free to movie things around they way you prefer

$tabs are all core tabs:

Code:
["tabs"]=>
  ["forums"]=>
  array(2) {
    ["title"]=> ''
    ["href"]=> ''
    }
  ["members"]=>
  array(2) {
    ["title"]=>''
    ["href"]=> ''
  }
  ["help"]=>
  array(2) {
    ["title"]=> ''
    ["href"]=> ''
  }

$extraTabs are all non core tabs:
Code:
["extraTabs"]=>
array(1) {
  ["middle"]=>
  array(1) {
    ["xz-articles"]=>
    array(6) {
      ["perms"]=> ''
      ["title"]=> ''
      ["href"]=> ''
      ["position"]=>
      ["linksTemplate"]=> ''
      ["selected"]=> bool(true)
    }
  }
}

so try using $extraTabs.middle.xz-articles.selected
or if you have it in the home position $extraTabs.xz-articles.selected

I haven't tried, but I think that should work

(To find out what variables are avaiable to you, you can dump out and of the params from Libray/XenForo/Dependencies/Public.php _getNavigationContainerParams )
 
Last edited:
Thanks, I already tried both, but they are not working. The tab is located under home/root and with these if conditions the dropdown menu is never visible .

PHP:
<li class="Popup PopupControl">
    <a href="{xen:link full:xz-articles/submit-new-article}" class="secondnavLink">{xen:phrase xz_submit_an_article}</a>
   
    <xen:if is="{$extraTabs.xz-articles.selected}">
        <a href="{xen:link full:xz-articles/submit-new-article}" class="secondnavArrow" rel="Menu"></a>
       
        <div class="Menu JsOnly tabMenu">
            <ul class="secondaryContent blockLinksList">
                <li><a href="{xen:link full:xz-articles/submit-new-article}">{xen:phrase xz_submit_an_article}</a></li>
                <li><a href="{xen:link full:xz-articles/published}">{xen:phrase xz_published}</a></li>
                <li><a href="{xen:link full:xz-articles/unpublished}">{xen:phrase xz_unpublished}</a></li>   
            </ul>
        </div>
   
    </xen:if>
</li>

I know there are not responsive in the moment, but I try to make them more or less responsive. This is an important element I need to use on my site.
 
Which template are you looking at

I did a quick test with the xenzine_nav template, to the top, I simply added:
Code:
1){$extraTabs.middle.xz-articles.title}
2){$extraTabs.end.xz-articles.title}
3){$extraTabs.home.xz-articles.title}
4){$extraTabs.middle.xz-articles.selected}
5){$extraTabs.end.xz-articles.selected}
6){$extraTabs.home.xz-articles.selected}
<xen:if hascontent="true">
etc
</xen:if>

This shows me
1) for the titles that are pumped out, it shows me that these variable are available
2) It tells me which one is actually selected

If you have selected home in the xenzine ACP options, then
$extraTabs.home.xz-articles.selected is the variable you want to use

Edit (missing .home in 2 posts above this)
 
Ah, great, thanks! it's working now with {$extraTabs.home.xz-articles.selected} in the template xenzine_nav. "home" was missing in my other tests.
 
Hi there,

first thanks for this really great and easy to use addon. Everything works fine and as intend! Thanks for that.

I switched my site from http to https a couple of hours ago and now I realized a small issue. You use this picture in your addon:

Code:
http://i.imgur.com/6RMhx.gif.

but this is hosted on a non https site, so my https "green light" brakes :) Is there a way to host this picture on a https host or even better not on an external host but include it with that addon?

Thanks in advance

Benny
 
The latest update (version 1.2.1) of nr.1 xenforo add-on has now added API for other non-default node types to use. Hopefully this will be added to the articles add-on. Also, ready to buy multiple copies when the widget framework is supported.:)
 
tenants updated XenZine Articles with a new update entry:

Permission and Tags

Fixes
  • Fix, so that this plugin is compatible with the Widget Framework
  • Article counts were displayed for user without submit-article-permissions, this is now fixed. Users that do not have this permisions now do not display counts in the members profile/members card.
  • When likes > 4 on an article, the like list overlay for these likes was not accessable, this is now fixed
  • Fixed FireFox issue that I wasn't aware of: subcategory selection
Article List...

Read the rest of this update entry...
 
I've released this as a Beta... I've tested it and installed it on a few sites (no issues)

However, I've released it as a beta since I'm about to go away for 10 days and any emergency fixes can not be made
So both 1.1.6 and 1.1.7BetaIII are available to download...

If you choose to use the beta, please test it on a local environment 1st


1.1.7, in addition to all that was mentioned here: updates for 1.1.7

1.1.7 Also now has permissions per category

This means it's now possible to give users/usergroup permissions as before.. but, if you specify an individual category via the ACP XenZine category list, you can define the permission per user/usergroup

You can also make an individual category private:


upload_2013-9-19_13-37-40.webp

upload_2013-9-19_13-38-28.webp

upload_2013-9-19_13-39-13.webp


As before, I've managed to do all this without increasing the query count for each page
 
Last edited:
Top Bottom