londoh VIP
Total posts: 137
25 Авг 2013 13:01

Hi

there's a 'user toolbar' which shows up in list view - as per screenshot

but I cant find any config option to get same toolbar to show up in record view.

Is this possible? If so - how to do it please!

Последние изменения: 15 Апр 2014


Sackgesicht VIP
Total posts: 1,636
25 Авг 2013 14:18

By default it is not included in Cobalt. You need a customized full article template.

Get the inspiration for the navbar from the default markup-template.. :D


londoh VIP
Total posts: 137
25 Авг 2013 15:04

ahh... ok. I thought as much, but figured it was worth an ask.

thanks


Sergey
Total posts: 13,748
27 Авг 2013 09:46

This feature become very obvious requirement for Cobalt. I think that section toolbar should be on article full view. I'll definitely add it in Cobalt 9.


ron.du VIP
Total posts: 113
27 Авг 2013 13:39

This feature become very obvious requirement for Cobalt. I think that section toolbar should be on article full view. I'll definitely add it in Cobalt 9.

can you also add dropdown category in section toolbar?


Sergey
Total posts: 13,748
30 Авг 2013 02:04

Sorry again ;-) I still don´t get the idea. What actions and menuitems should be visible on full article view ?

Section Home

User menu

test and advanced search

Post here ...


ron.du VIP
Total posts: 113
30 Авг 2013 02:17
pepperstreet

Sorry again I still don´t get the idea. What actions and menuitems should be visible on full article view ?

Section Home

User menu

test and advanced search

Post here ...

exactly :) . thanks Sergey


Sergey
Total posts: 13,748
30 Авг 2013 02:30

Of course there will be option for every element in toolbar.


londoh VIP
Total posts: 137
30 Авг 2013 05:54

Section Home

User menu

test and advanced search

Post here ...

yes thats it

and also... what about** Prev | Next** links?

So user can navigate thru current record set. (big question: what is current record set when in record view?)

I was going to raise this in a separate thread but I guess its appropriate question here at this point.

I need to implement this feature - which is actually why I started wondering about toolbar in record view, and so the thread :D

unless its me who is missing the point again:

Section Home

User menu

test and advanced search

Post here ...

On article full view we have the "article controls"

what/where are article controls? Is this some other critical part of cobalt I've missed?

@sergey: In your masterplan is this toolbar still for cobalt 9?

If so when is cobalt 9 due?


Sergey
Total posts: 13,748
01 Сен 2013 02:41

@sergey: In your masterplan is this toolbar still for cobalt 9?

If so when is cobalt 9 due?

Earliest at the end of december.

@sergey: In your masterplan is this toolbar still for cobalt 9?

If so when is cobalt 9 due?

and also... what about Prev | Next links?

http://support.mintjoomla.com/en/cobalt-7/ideas/Navigation +-+previous%2C+next+and+up-2269.html


londoh VIP
Total posts: 137
01 Сен 2013 03:56

thanks for link

yes, as I thought....

(big question: what is current record set when in record view?)

and you covered my concerns about this question in that cobalt7 thread

OK so I must implement this myself. Even if 'simple' navigation thru category, and accept potential failings in logic.


Sergey
Total posts: 13,748
01 Сен 2013 06:37

When you do it tell me how you did it.


londoh VIP
Total posts: 137
01 Сен 2013 13:35

When you do it tell me how you did it.

if I get a reasonably generic workable solution sure I will (but I was hoping you were going to tell me :D )

So anyway... I havent looked at this in depth yet, and I havent fully understood how cobalt does filters.

But in this case I will be ok with simple nav thru category so I dont think I have to worry about that too much

So assuming I just need record ID's for the prev and next records

And based on db tables I'm kinda expecting I can do something like this to get those ID's per category:

SELECT max(r.id) prevNextRecId FROM #__js_res_record r 

INNER JOIN #__js_res_record_category c ON c.record_id = r.id

WHERE c.catid = $catId

AND r.id < $recId

AND r.published = 1

# AND ... 

# AND ...

# ORDER BY something asc something_else desc

UNION

SELECT min(r.id) prevNextRecId FROM #__js_res_record r 

INNER JOIN #__js_res_record_category c ON c.record_id = r.id

WHERE c.catid = $catId

AND r.id > $recId

AND r.published = 1

# AND ... 

# AND ...

# ORDER BY something asc something_else desc

[theres probbaly a more efficient way of doing that, but thats the idea]

its the additional where clauses and order by that maybe unknown,

Sergey you know your code - will that work?

how else could I do it?

what else do I need to know?

thanks :D


Sergey
Total posts: 13,748
02 Сен 2013 07:28

Wrong

AND r.id > $recId

and MIN(r.id) and MAX(r.id)

What if it is sorted by create date. It may happen that next article is lower ID but next of next is higher.


Sergey
Total posts: 13,748
02 Сен 2013 07:31

What I mean if it is sorted by time then it should be

AND r.ctime > $rctime

and

MIN(r.ctime) and MAX(r.ctime)

And so one. Different for every order. But we not always order by column in _js_res_record table. Lets say we order by user name. Then is is joined table. Changes everything. And we order by fields again different scenario.


londoh VIP
Total posts: 137
02 Сен 2013 09:35

thanks for input.

Changes everything ... again different scenario

for much as I dont understand, I do get that this could get very complex!

And really that is why this is my target:

Changes everything ... again different scenario

'simple' navigation thru category

at least for my use case at this time, that much will do.


Sergey
Total posts: 13,748
03 Сен 2013 00:34

for much as I don't understand, I do get that this could get very complex!

This is what I thought at first. Then I stacked. I opened forum topics on few forums but I could not think out a final solution.

So if you solve the problem and it works just tell me how.

And do not worry about filters now. I will tell you what to do to enable current filters applied to the query.


londoh VIP
Total posts: 137
03 Сен 2013 17:03

so here's some basic code for simple prev|next cat navigation

It appears to do what I expect with my current dev data.

query uses order by and limit, not aggregate functions. I'm not sure about non-mysql db

It doesnt take into account multiple categories. (Thats easy enough, but then user would follow a meandering trail that isnt appropriate for what I need)

It doesnt take into account filters or user categories

average time to run code is 0.0015secs

it'll work in views/record/tmpl/default_record_default.php - under the article tag is good.

feedback please from experienced cobaltiers


<?php $itemid = $item->id; $app = JFactory::getApplication (); $jinput = $app->input; $catid = $jinput->getInt ( 'cat_id', null ); // if not catid: get it from item - item->categories[0] ? // maybe loop thru multiple cats and join on cats ? $query = "(SELECT r.id rid FROM #__js_res_record r inner join #__js_res_record_category c on c.record_id = r.id where c.catid = $catid and r.published = 1 and r.id < $itemid order by r.id desc limit 1) UNION (SELECT r.id rid FROM #__js_res_record r inner join #__js_res_record_category c on c.record_id = r.id where c.catid = $catid and r.published = 1 and r.id > $itemid order by r.id limit 1)"; $db = JFactory::getDbo (); $db->setQuery ( $query ); $list = $db->loadAssocList (); if ($list) { $prevnext = '<div class="span12">'; foreach ( $list as $l ) { if ($l ['rid'] < $itemid) { $prevrec = ItemsStore::getRecord ( $l ['rid'] ); $url = JRoute::_ ( Url::record ( $prevrec, null, null, $catid ) ); $prevnext .= '<div class="pull-left span6" style="text-align: left;">' . JHtml::link ( $url, $prevrec->title ) . '</div>'; } if ($l ['rid'] > $itemid) { $nextrec = ItemsStore::getRecord ( $l ['rid'] ); $url = JRoute::_ ( Url::record ( $nextrec, null, null, $catid ) ); $prevnext .= '<div class="pull-right span6" style="text-align: right;">' . JHtml::link ( $url, $nextrec->title ) . '</div>'; } } $prevnext .= '</div>'; echo $prevnext; } ?>

Sergey
Total posts: 13,748
04 Сен 2013 02:30

This is very narrow code. it does not reflect default ordering. It always shows articles in the same order.


Sergey
Total posts: 13,748
04 Сен 2013 02:56

I just want to say this will not fit Cobalt like core feature. users will expect page navigation reflect current list or records in the same order and with all filters applied.


londoh VIP
Total posts: 137
04 Сен 2013 04:46

I just want to say this will not fit Cobalt like core feature

yes I agree.

It is what it is: simple prev|next thru records in current category.

I think it should be easy enough to include ordering, but I didnt go any further yet becos it does what I need right now.

I'm sure its possible to do it much better... @sergey how? :D

Работает на Cobalt