This object is in archive! 

Order items in left block

Archived Rafael A. 12 years ago

Can we change the order of response types in the block on the left (ideas, problems, questions and thanks)? (please see the image)

Best Answer
photo

To change the order of responses types to be shown in the needed order all over the system you need to go to handlers folder of each type like application/modules/ideas and in function:

onRightMenu($params) change order parameter

Replies (22)

photo
1

To change the order of responses types to be shown in the needed order all over the system you need to go to handlers folder of each type like application/modules/ideas and in function:

onRightMenu($params) change order parameter

photo
1

We have performed this procedure on each module and is reflected throughout the site except in the block on the left (LeftBlock.php), this menu stays in the default order brings the product

photo
4

To change the order in left menu go to the database and in responses_types table set required order in relative field.

photo
1

Work perfect! Thank you.

photo
1

Hey Stas!


We're trying to do the same thing - would to have Questions 1st.


I updated the code files per the "official answer" above, but it's not working for us.


Take a look - ideas is still first. :-)

http://forums.askdanandjennifer.com/


Note that I updated the database responses_types (field: order), and that DID change the order, but only in the left block view of "all questions": http://forums.askdanandjennifer.com/responses/questions/status/all


But we would like this order to be default on the homepage (first questions, then problems, then ideas...) - and same in the widget for asking a question at the top of the homepage.


Suggestions?


Thanks!!

photo
1

Jennifer B. wrote:

Hey Stas!

We're trying to do the same thing - would to have Questions 1st.

I updated the code files per the "official answer" above, but it's not working for us.

Take a look - ideas is still first. :-)

http://forums.askdanandjennifer.com/

Note that I updated the database responses_types (field: order), and that DID change the order, but only in the left block view of "all questions": http://forums.askdanandjennifer.com/responses/questions/status/all

But we would like this order to be default on the homepage (first questions, then problems, then ideas...) - and same in the widget for asking a question at the top of the homepage.

Suggestions?

Thanks!!

If you did everything correctly - try to clean the cache by pressing "Clean Cache" button on Administration area.

photo
1

Hi Paul. We did empty the cache - tried several times. :-)


We tried this on both of our installs and got the same results. It did not work.

photo
1

Jennifer B. wrote:

Hi Paul. We did empty the cache - tried several times. :-)

We tried this on both of our installs and got the same results. It did not work.

Now I have the better way for you.

  1. Open file \application\modules\system\templates\_right-menu.phtml
  2. Find line 5 with code <div class="<?php echo $item->class?>">
  3. Insert after this line the following code:
    1. <?php
    2. $item->findById('questions')->setOrder(1);
    3. $item->findById('problems')->setOrder(2);
    4. $item->findById('ideas')->setOrder(3);
    5. $item->findById('thanks')->setOrder(4);
    6. $item->rewind();
    7. ?>

  4. Now you have something like this:
    1. ......................
    2. <div class="<?php echo $item->class?>">
    3. <?php
    4. $item->findById('questions')->setOrder(1);
    5. $item->findById('problems')->setOrder(2);
    6. $item->findById('ideas')->setOrder(3);
    7. $item->findById('thanks')->setOrder(4);
    8. $item->rewind();
    9. ?>
    10. <?php foreach($item as $i):?>
    11. <div class="overflow">

      .......................

  5. Save file and clean the cache.

photo
1

Hi Paul!


didn't work for me :-)


I made the change - see screenshot: http://www.evernote.com/shard/s79/sh/384a7eb5-40d5-44df-bd2d-6f491e003eff/d303c1a6771cdee59a59756cd686606b


and cleaned cache in administration menu.


then went back to homepage of the forums, reloaded, still same.

http://forums.askdanandjennifer.com/


** It would be REALLY, Really, Really awesome if you guys made this order setting a configuration option in the system so it would not require any file and database changes. some people want ideas first, but many want questions first, like we do. :-) **


Thanks!

photo
1

also fyi this is a "stock" 2.0 UseResponse installation, which Stas is handling the import into.

photo
1

Jennifer,

Previous snippet is for sorting in right block called Statistics.

To sort response types on the main page go to \application\modules\system\controllers\IndexController.php file and comment line 34 (ksort($data->sections);). Then open ur_module table and replace "questions" module "load_order" to 3 and "ideas" module "load_order" to 5.

Thats all!

photo
1

Hey Paul! OK, we're ALMOST there. :-)


Take a look - http://forums.askdanandjennifer.com/


Per your advice above:

1.) the section order on the homepage DOES show questions first. YEAH!!!

2.) the widget at the top of the homepage ALSO shows questions first. YEAH!!


BUT - the widget at the top STILL has "idea" as the default seelection, even though it's 3rd. :-)


So - how do I change Questions to be the default selection in the top widget?


Thanks!

photo
1

Hi, Jennifer.

What you mean when say "top widget"?

If you means responses tabs I see that everything is fine. See attached screen.

photo
1

Hi Paul!


Yes, that is what I am referring to - the responses tabs.


The order is fine now - but Questions should be the default selected tab now that it is first. Instead, "ideas" is still selected.


Thanks!

photo
1

Oh, sorry. Now I understood what you are talking about.

I will prepare solution for you from 1-2 hours.

Keep following this topic.

photo
1

Jennifer B. wrote:

Hi Paul!

Yes, that is what I am referring to - the responses tabs.

The order is fine now - but Questions should be the default selected tab now that it is first. Instead, "ideas" is still selected.

Thanks!

Jennifer,

As I promised:

  1. Open file \public\assets\modules\system\js\frontend.js
  2. Find line 16:
    1. $("#response-add").submit(function(){

  3. Add above this line (between lines 15 and 16) code:
    1. $('#question').click();

  4. As result you must have the following
    1. ...............................
    2. $('.findAddObjects-tabs a').click(function(){
    3. $('.findAddObjects-tabs a').removeClass('active');
    4. $(this).addClass('active');
    5. $('form#response-add').attr('action', $(this).attr('href'));
    6. $("form#response-add p#info").show();
    7. $("form#response-add p#empty").hide();
    8. return false;
    9. });
    10. $('#question').click();
    11. $("#response-add").submit(function(){
    12. if ($(this).find(".textInput input").val() == '') {
    13. $(this).find("p").html(App.t("Enter text to search response!")).css("color", "red");
    14. return false;
    15. }
    16. ...........................

  5. Save file.

See attached screen for help.


Have a nice day!

photo
1

Hi Paul.


Thank You! That worked.


There's just one more place I found... The Add Response page.

See below.


http://support.theblogpress.com/response/add


I think that's all of the places?


Any chance we'll see this as a system setting soon - this is a lot of places to change the code! :-)

photo
1

Jennifer B. wrote:

Hi Paul.

Thank You! That worked.

There's just one more place I found... The Add Response page.

See below.

http://support.theblogpress.com/response/add

I think that's all of the places?

Any chance we'll see this as a system setting soon - this is a lot of places to change the code! :-)

  1. Open file \public\assets\modules\system\js\frontend.js
  2. Find line 68 starting with:
    1. add: function () {

  3. Insert after this line the following code
    1. $(function(){$('#question').click()});

  4. Save file.

We'll include your suggest in our roadmap, but it would be implemented near with version 3.0 release.

Thank you.

photo
1

Hi Paul, thank you! I had missed this note from you the other day, and just now saw it!


I just updated the code, and now it all works great!

  1. We'll include your suggest in our roadmap, but it would be implemented near with version 3.0 release.

That's really great news! LOL Jennifer and I were just beginning to itemize all the code changes we've made so far for this, and with the next code update coming up soon, it was a bit of a concern. :-)


Thanks again!Dan (and Jennifer)

photo
1

Hi Paul. I too wanted to say thank you sooo much for your help on this one!

photo
1

Hey Paul! I just wanted to see if you have an ETA for what update this will be included in. :-)

LOL we have not yet been able to update to the last UseResponse point release because I don't know anymore what various code tweaks I made to files to make this order change work. So I'm really

photo
1

Dan,

We don't have plans to incorporate these features in the release this year. Maybe we'll think of it - next year

Replies have been locked on this page!