EPrints Technical Mailing List Archive

Message: #08773


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Browse View


CAUTION: This e-mail originated outside the University of Southampton.
Can anybody help me to separate month from the date field?
Here I used the code in the views.pl file but Its not working...
I am sharing the 
          id=>"journal_volume",
        fields=> "publication,date;res=year",
                    new_column_at => [1, 1],
                    allow_null => 0,
#                    mode => "sections",
# open_first_section => 1,
# group_range_function => "EPrints::Update::Views::cluster_ranges_30",
# grouping_function => "EPrints::Update::Views::group_by_a_to_z",
#                   group_sorting_function => "EPrints::Update::Views::default_sort",
        order=>"-date/title",
                    variations => [
                            "creators_name;cloud,jump=plain,cloudmin,no_seperator","date;month",
"DEFAULT" ],
                    filters => [
                        { meta_fields => [ "divisions" ], value => "Univ6", describe => 0 }
                       ],

},



On Wed, Oct 13, 2021 at 12:32 PM Sonu Yadav <yvsonu1987@gmail.com> wrote:
Hi,
The following variation is not working. when I used date_month it is showing an error. when I used to date;res=month the following things is showing:-
image.png
variations => [
                           "date_month",
        ];


Also When I use this date_month in the menu also but it is showing an error that there is no metadata field.

On Tue, Oct 12, 2021 at 1:28 PM David R Newman <drn@ecs.soton.ac.uk> wrote:

Hi Sonu,

In response to your questions:

1. I am 100% not sure what you mean by question 1.  I think what you are asking is if you have multiple fields that have the same sort of data how can they be incorporated into the same view.  An example of this is creators and editors name.  This can be done with the following under menus:

 fields => [ "creators_name", "editors_name" ],

If you add an additional block to menus then that will be a subdivision to previous block as demonstrated in the config you pasted for the type view below.  You get pages for types and subpages for year.

If you have fields that do not have the same type of data, then this may not work or you will get a very odd looking view.

2. I don't think anyone has every asked to split by month but without caring about the year as well.  I am not sure but the following may work, as date_month is stored as its own sub-field:

        variations => [
                           "date_month",
        ];

3. If you have a view for divisions you cannot get it to specifically display differently for one division over another.  If one division has a lot more items than another then various settings for the view can be used to limit how many items appear on a page.  Say you use creator's name; for a large division using creator's name as a subdivision might lead to individual sub-pages for each starting letter for a creator's name, whereas a small division may only have 2-3 pages with a wide spectrum of starting letters on each page, as overall they have less items to display.

4. I think the best solution to your problem in 3 is like you question for 4 and to have a specific view for this presumably large division and then you can configure this how you like and different from other divisions.  To do this you need to add a filter (after variations) for divisions like:

filters => [
                        { meta_fields => [ "divisions" ], value => "DIVISION_ID", describe => 0 }
                ],

Note that the value is the division ID not the label so it won't be "Department of Mass Communication" but probably some shortened value used as its ID under the subject tree (e.g. dept_mass_comm).

Does anyone else have any idea for these questions.  With views there is often more than one way to solve a problem and when you are aware of more options, you can consider which one most closely meets your requirements or sometimes maybe thsu even allows you to do something you had not thought of.

Regards

David Newman

On 12/10/2021 05:46, Sonu Yadav via Eprints-tech wrote:
CAUTION: This e-mail originated outside the University of Southampton.
How to separate the month from the date for menu and grouping in browse view page:
I have Four questions/query
1. how to make one more field in the menus
2.  I have two menus, first is the type of the item then the other is the year then I want to make one more that is the month when I use date;res=month in the menu it is showing month with the year but I want to group by month only.
{
                id => "type",
                menus => [
                        {
                                fields => [ "type" ],
                                reverse_order => 1,
                                allow_null => 1,
                                new_column_at => [10,10],
                        },
                        {
                                fields => [ "date;res=year" ],
                                reverse_order => 1,
                                allow_null => 1,
                                new_column_at => [10,10],
                        }
                       
                ],
                order => "creators_name/title/editors_name",
                variations => [
#                         "creators_name;first_letter",
#                         "date;res=year",
                           "date;res=month",
#                         "publication;first_letter",
#                         "volume",
#                         "number",
                           "DEFAULT" ],
        },

3. Is there any way to categorize a particular division menu by year, then by month? when I create the menu functionality in the views.pl it applies to all the division categories.
4. Is there any way to generate the views of the particular division, not the whole division like I want to create a browse view of the Department of Mass Communication only.

Thanks,

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

Virus-free. www.avg.com