[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Problem template on views



Hi Jens,

I have just tried to recreate this on my test EPrints repository 
(running 3.4.4).? I was able to successfully create a type browse view 
to use a template and then revert back to the default template.? 
However, just changing the configuration and reloading the web server is 
insufficient, I also had to run generate_views to regenerate this view.? 
(I think "epadmin refresh_views ARCHIVE_ID" would have done a similar 
job).? However, I note two errors I encountered copying the exact 
configuration you used for the type browse view you provided:

1. The 'name' field does not exist for an eprint data object in my 
repository.? I therefore substituted this for creators_name and I was 
able to generate the menu page for this browse view.

2. When it came to running generate_views to update the template used, 
this produced the following error message:

 ? "Can only perform process_distinctby on multiple fields with the same 
field type"

I therefore removed the field "title" as it and "creators_name" are not 
the same type.? As I don't know what type the "name" field in your 
configuration is, I don't know if you will have a similar issue.

My advice would be to regenerate the view from the command line:

EPRINTS_PATH/bin/generate_views ARCHIVE_ID --view type

And see if you get any error messages.? If not, you should see the type 
browse view updated to use the new template.? If you do see an error, 
hopefully you should be able to make the appropriate changes to your 
browse view configuration to fix this.? Then you can try running 
generate_views again.

Regards

David Newman

On 09/01/2023 8:29 am, Jens Witzel via Eprints-tech wrote:
> *CAUTION:* This e-mail originated outside the University of Southampton.
>
> Hi list
>
> Does anyone have experience with assigning templates to views? Please 
> have a look at the following example views.pl. I am trying to set 
> templates and it works for direct views like id=divisions, but not for 
> id=type:
>
> $c->{browse_views} = [
>
> ??????? {
>
> ??????????????? id => "divisions",
>
> allow_null => 1,
>
> ??????????????? menus => [
>
> { fields => [ "divisions" ] },
>
> ???? ???????????],
>
> ??????????????? order => "-name/title",
>
> citation => "screen",
>
> variations => [
>
> "type",
>
> ??????????????? ],
>
> template => 'views',
>
> ??????? },
>
> ??????? { id=>"type",
>
> menus=>[
>
> {
>
> fields=>[ "type" ],
>
> hideempty=>1,
>
> },
>
> {
>
> fields=>[ "name", "title" ],
>
> hideempty=>1,
>
> 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",
>
> new_column_at => [ 0 ],
>
> ?????????????????????},
>
> ??????????????? ],
>
> template => 'views',
>
> ??????? },
>
> ];
>
> Thx
> Jens
>
> -- 
> Jens Witzel
> Zentrale Informatik
> Universit?t Z?rich
> Stampfenbachstrasse 73
> CH-8006 Z?rich
>
> mail: jens.witzel at uzh.ch <mailto:jens.witzel at uzh.ch>
> phone: +41 44 63 56777
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.zi.uzh.ch%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C65cf9c374cf94c1a9a4708daf22793d5%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638088549033081576%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=k1GUSlrcWoEl2HV8V9ta8W%2BqOMGdwnS1bLdLHa%2BGJME%3D&reserved=0 
> <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.zi.uzh.ch%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C65cf9c374cf94c1a9a4708daf22793d5%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638088549033081576%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=k1GUSlrcWoEl2HV8V9ta8W%2BqOMGdwnS1bLdLHa%2BGJME%3D&reserved=0>
>
>
> *** Options:http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C65cf9c374cf94c1a9a4708daf22793d5%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638088549033081576%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uld4Py5DWWmHXUMw6w3W7mvNDf1u9P%2BHnTO2PIKL8wQ%3D&reserved=0
> *** EPrints community wiki:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C65cf9c374cf94c1a9a4708daf22793d5%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638088549033081576%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4ph2UeuqdUlaKv3YQWQ3sT88h2j1qlzfu52kTQ6D450%3D&reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20230109/875ef697/attachment.html