By Tim Hunt on Wednesday, 05 July 2017
Likes 0
Views 888
Votes 0
Hi there!

I'm trying (without really knowing for certain if it's possible, I should add) to create a new menu view for Pages. I need an alternate menu layout for a specific Page item, without overriding all the other Single Page views on the site.

I've gone along the lines in the Joomla documentation by copying and renaming the XML file in /components/com_easysocial/views/pages/tmpl/item.xml to a unique name (marketplace.xml) and placing it in my template, and changed the contents to reflect the new view name. I've then copied across the PHP files from the wireframe/pages/item/ into my template under /html/com_easysocial/pages.

The new menu view appears and allows me to create the item, but when following the link the page I'm taken to is the default Pages view showing all pages on the site, rather than the Single Page view. I've tried putting the PHP files in a subfolder /marketplace/ to match the XML filename, and I've also tried renaming the files to have marketplace_ as a prefix (like you would do for core components with sub views). Neither has worked so I'm a little at a loss.

I'm really hoping this is something it's possible to do (I haven't had an issue doing similar for other components but ES does have a notably different template setup from what I'm used to with the added themes) - if not my alternative would be to use a custom class for the page and then just hide certain parts of the layout with CSS, but that would be messy and not really what I need.

Many thanks in advance
Tim
Hi Tim,

Once you've create another xml file (marketplace) you need to do some custom code in the file:
.../components/com_easysocial/views/pages/view.html.php
and duplicate the item function (line 664- line 980) then alter the function name to marketplace : https://www.screencast.com/t/NuETSU1M
in the function you need to replace the folder path from /item to /marketplace https://www.screencast.com/t/Lv31EV2aA https://www.screencast.com/t/WGPavhO7MVRD so it will get the correct files.

Hope this helps.

You're suggested to backup the file that you want to customize beforehand for precaution
·
Wednesday, 05 July 2017 13:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Fadhli,

Many apologies I just realised I never responded to you! This worked exactly as I needed - when I get more time I'm going to have a go at setting up the new menu view as a plugin rather than keeping the core files edited directly, but this is working really well in the meantime.

Thank you for all your help,

Tim
·
Monday, 31 July 2017 03:44
·
0 Likes
·
0 Votes
·
0 Comments
·
It's okay Tiim, and you are most welcome

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock and mark this thread as resolved.

Have a nice day ahead
·
Monday, 31 July 2017 10:10
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post