Listing view of related data in repeatable joins

Status
Not open for further replies.

AMTI

Member
  • Joomla 2.5.9
  • Fabrik 3.0.7 with latest GitHub Update
  • Browser info not necessary
Where is the php script/code that produces the view of related data that just so happens to also be repeating by left joins.

In the related data field i am using {listname___elementname} as the button text. And it's coming out as a unorderd list, which is fine, but the counter of items is not in the list and is bugging me and i want to either remove it or work with it.

Please see attached screenshot. For clarity.
I'm using the default templates for everything.

Thanks again as always,
Trip
 

Attachments

  • related_data.png
    related_data.png
    84.8 KB · Views: 314
Where is the php script/code that produces the view of related data that just so happens to also be repeating by left joins.
Deep in the bowls of the list model, I don't think you will be able to edit it

but the counter of items is not in the list and is bugging me and i want to either remove it or work with it.
You can add some css to do that:

Code:
    ul.fabrikRepeatData {
    list-style-type: decimal;

}
 
Wow, you weren't kidding about the bowels of the list model.

The unordered list only appears with two or more items, not just a single item, so there's no real specific css hook there.

In order to make the css specific enough for the ul you need a little more code:

Code:
#listform_$c  ul.fabrikRepeatData {
    list-style-type: decimal;
}

How about an option to turn off the counter in the related data section of the list settings.

Or I guess an easier way would be to have a <span> tag with some specific class wrapped around the counter. That way I could set it to display: none; or display: block; so it always appears at the top (which isn't happening with just one item)

Any chance a git update with this?
 
Wow, you weren't kidding about the bowels of the list model.

LOL! Yup, not code we are particularly proud of, but a natural result of how Fabrik has grown over the years. Just FYI, we are in the process of completely rewriting how all that stuff works in 3.1, with a much, MUCH cleaner implementation.

Or I guess an easier way would be to have a <span> tag with some specific class wrapped around the counter. That way I could set it to display: none; or display: block; so it always appears at the top (which isn't happening with just one item)

Any chance a git update with this?

If you can tell me exactly where you want that, i.e. find the code and show me, I'll do it. I'm swamped with a few issues that have to take priority at the moment.

-- hugh
 
I'm not exactly sure even where the <ul> are being created with <li>'s. or for that matter where the row counter is being php echo'd. All i'm aksing for is a simple <span> around the link in a related data view with 1 or more rows.
IE:
For related date in list view with one item:
Code:
<a href="#"><span class="counter-single">(1)</span>Item number 1
For related data in list view with more than one item:
Code:
<a href="#"><span> class="counter-multi">(2)</span>
<ul>
  <li>Item number 1</li>
  <li>Item number 2</li>
  <li>etc...</li>
</ul
For some reason this really should be a template thing, but considering that the part that generates this portion is part of the list model in the MVC of Joomla, altering that code privately would be pointless. And like you said, its burried in there some where. I'm sure a 5 minute conversation with Rob would have this pin pointed in no time.
 
in the list model...

I found a function around line 1502 for related table links get the record count of the table's rows...

but also around lines 1358 to 1359 where the count gets outputted in related links?
 
In order to make the css specific enough for the ul you need a little more code:
That would depend on the Joomla template you are using, but yes specifiying an ID in the declaration makes it more specific and further down the css cascade so its more likely to be applied


How about an option to turn off the counter in the related data section of the list settings.

try this:

Code:
#listform_$c  .related ul.fabrikRepeatData {
  list-style: none;
}
 
forgot to say - we 'try' to avoid admin options to deal with the lesser requested styling options, we already have a lot of buttons, and to paraphrase a french saying "too many buttons kill the buttons", meaning that the UI becomes less intuitive for users attempting general tasks as they need to scan through more and more options to find the one they are after.
 
I agree, avoid the admin options.

But the Counter exists outside of the <ul>.... that's why I'm asking for a <span> around the counter, so I can remove it or consistently style it.

Please see attachment for extreme clarification... where you see the numbers (1) or (2) etc, have the php output <span>(1)</span or <span>(2)</span>

Avoids all admin options and opens a world or possibilities.
 

Attachments

  • related_2.png
    related_2.png
    118.5 KB · Views: 260
Sounds reasonable. Do you just need a vanilla span, as you specified above, or would have a new class for it help? And do you want another span around the title?

Like:

Code:
<span class="fabrik_related_data_count">2</span><span class="fabrik_related_data_title">Foo Bar</span>

-- hugh
 
I would very much like it just as you mentioned in your example code! That would be perfect!

Thank you,
Trip
 
ah sorry I just read your last post and thought this was resolved, no idea why I thought that though!

Anyway, I've added a span with the class 'fabrik_related_data_count' around the counter.

I'm a bit more wary of the other change Hugh suggeted as wrapping a span around potentially a ul is not allowed, and wrapping using a div might well produce unexpected results.
 
Status
Not open for further replies.
Back
Top