Can i put profile picture and cover photo in phpfox member index? - phpfox

I need to put profile pic and cover photo on left block in member index I have try every single method but useless
So any help please
Actually phpfox 4.7
Please admins don't close the post I really need help with this tutorial
Here is a screenshots
https://i.stack.imgur.com/TewzF.jpg
https://i.stack.imgur.com/yI0FG.jpg

Go to AdminCP - Appearance - Blocks - Add Block
Now Fill the form as below
Product = Core
Module = Profile
Title = Anything(wont display public)
Type = PHP Block File
Page = Member Home Page (core. index-member)
Component = header (for cover photo), logo (for logo)
Placement View Sample Layout = Block 1 (This will place the image on left block

Related

Kentico 13 Xperience View Component displaying Page Type field data

If I had a page type called "MySite.TextBox" and it had two fields: "Title" and "Content" what all would be required for me to make a view component that pulls all page types from the site searching from "/" and looking down to have it appear as a list of items in any view, including the layout view, using something like <vc: text-box-list > in a view, such as the _layout
What files would I need to create aside from the TextBoxList view component?
I know I'll need to make a generated code file for the MySite.TextBox page type. But it's where I set up and establish the rules for outputting the list that things get fuzzy.
For instance if I wanted to establish rules like:
var textBoxList = DocumentHelper.GetDocuments("MySite.TextBox").TopN(5).Path("/", PathTypeEnum.Children).OrderByAscending("Title").ToList();
Would that be a part of the view component or something else?
I would just really really love to have an example. I hate that the Dancing Goat and Medio Clinic sites do not have one.
1. Follow the below to Create a widget -
https://docs.xperience.io/developing-websites/page-builder-development/developing-widgets
2. Retrieves pages of multiple page types from the '/' section of the content tree:
var pages = pageRetriever.RetrieveMultiple(multiDocumentQuery => multiDocumentQuery
.Path("/", PathTypeEnum.Children));
Reference:
https://docs.xperience.io/custom-development/working-with-pages-in-the-api#WorkingwithpagesintheAPI-Retrievingpagesonthelivesite
3. Retrieve Common data from multiple page types
var commondata=Pageretriver.RetriveMultiple(multiDocumentQuery=> multiDocumentQuery
.Types("PageType1","PageType2)
.WithCoupledColumns())
.Select(page=> new <desiredobject name>
{
fieldName=page.GetString("fieldName")
});
Reference
https://docs.xperience.io/custom-development/working-with-pages-in-the-api/reference-documentquery-methods

Link directly to a notebook page in a view

I have an view that extends the current project view, where we add multiple tabs (notebook pages) to show information from other parts of a project.
One of these pages is an overview page that summarizes what is under the other tabs, and I'd like to link the headlines for each section directly to each displayed page. I've currently solved this by using the index of each tab and calling bootstrap's .tab('show') method on the link within the tab:
$(".overview-link").click(function (e) {
e.preventDefault();
var sel = '.nav-tabs a:eq(' + $(this).data('tab-index') + ')';
$(sel).tab('show');
});
This works since I've attached a data-tab-index="<int>" to each header link in my widget code, but it's brittle - if someone adds a tab later, the current indices will be broken. Earlier I relied on the anchor on each tab, but that broke as well (and would probably break if a new notebook page were inserted as well).
Triggering a web client redirect / form link directly works, but I want to show a specific page in the view:
this.do_action({
type: 'ir.actions.act_window',
res_model: 'my.model.name',
res_id: 'my.object.id',
view_mode: 'form',
view_type: 'form',
views: [[false, 'form']],
target: 'current'
});
Is there any way to link / redirect the web client directly to a specific notebook page tab through the do_action method or similar on FormWidget?
If I understood well you want to select the tab from the JavaScript (jQuery) FormWidget taking into account that the id could change if anybody install another module that adds another tab
Solution 0
You can add a class to the page in the xml form view. You can use the id of the element selected by this class name in order to call the right anchor and select the right tab item. This should happen when the page is completely loaded:
<page class="nb_page_to_select">
$('a[href=#' + $('.nb_page_to_select').attr('id') + ']').click()
NOTE: As you have said the following paragrah I assume that you know where to run this instruction. The solution I suggest is independent of the index.
This works since I've attached a data-tab-index="<int>" to each
header link in my widget code, but it's brittle - if someone adds a
tab later, the current indices will be broken. Earlier I relied on the
anchor on each tab, but that broke as well (and would probably break
if a new notebook page were inserted as well).
Solution 1
When the page is loaded you can get the tab list DOM object like this:
var tablist = $('ul[role="tablist"]')
And then you can click on the specifict tab, selecing by the text inside the anchor. So you don't depend on the tab index:
tablist.find('a:contains("Other Information")').click()
I think if you have two tabs with the same text does not make any sense, so this should be sufficient.
Solution 2
Even if you want to be more specific you can add a class to the notebook to make sure you are in the correct notebook
<notebook class="nt_to_change">
Now you can use one of this expressions in order to select the tab list
var tablist = $('div.nt_to_change ul.nav-tabs[role="tablist"]')
// or
var tablist = $('div.nt_to_change ul[role="tablist"]')
Solution 3
If the contains selector doesn't convince you because it should be equal you can do this as well to compare and filter
tablist.find('a').filter(function() {
return $.trim($(this).text()) === "Other Information";
}).click();
Where "Other Information" is the string of the notebook page
I didn't tried the solution I'm giving to you, but if it doesn't work at least may be it makes you come up with some idea.
There's a parameter for XML elements named autofocus (for buttons and fields is default_focus and takes 1 or 0 as value). If you add autofocus="autofocus" to a page in XML, this page will be the displayed one when you open the view.
So, you can try to add this through JavaScript, when the user clicks on the respective link -which honestly, I don't know how to achieve that by now-. But you can add a distinctive context parameter to each link in XML, for example context="{'page_to_display': 'page x'}". When you click on the link, I hope these context keys will arrive to your JS method.
If not, you can also modify the fields_view_get method (here I wrote how to do that: Odoo - Hide button for specific user) to check if you get the context you've added to your links and add the autofocus parameter to the respective page.
As you said:
This works since I've attached a data-tab-index="" to each header
link in my widget code, but it's brittle - if someone adds a tab
later, the current indices will be broken.
I assume that your app allow multi-user interaction in realtime, so you have to integrate somewhere in your code, an update part function.
This function will trig if something has changed and cleanout the data to rebuilt the index in order to avoid that the current indices will be broken.

Displaying multiple images from scene7 image set on category image

I have taken over a site and am looking for some assistance.
The site currently detects if a product has a scene7 image set associated to it, and then adds IS to the code to display the image set.
I am trying to do this for category image as well, if I hardcode _IS (product sku + _ID) the image set is loaded nicely, but obviously any product sku with no image set, the image doesn't load.
This is the code with the _IS hardcoded:
flyoutViewer.setAsset("/${catalogEntryDetails.partNumber}_IS");
This snippet of code detects whether there is a set or not:
var asset = '/' + wc.render.getContextById('ItemDetailsContext').properties.partNumber;
if (data['catalogRecord.exists'] == 1) {
asset += 'IS';
}
Am I missing something major? My guess I am, I can dig out more code if necessary.
Help would be appreciated?!

How to have only one tab open in wxribbon bar in wxpython?

I am building a GUI and I am using wxribbon for wxpython. I want to have only one tab(ribbon page) in when user starts my app, from where user can dynamically add more pages or can add panels and buttons to a page. I am able to achieve all the dynamic parts of ribbon. The only problem I have is that I am unable to start with only one ribbon page. When I define only one page, I don't see the ribbon bar(tab bar), what I see is only the page. Now, when I define two page in the beginning, then I see the bar. Can someone tell me what I code have to change in wxribbon so that I am able to have a tab bar visible with only one page in it. Any help would be great. Thanks!. The sample code I am using to add a page is as follows :
import wxRibbon as RB
self._ribbon = RB.RibbonBar(self, id = wx.ID_ANY)
page_1 = RB.RibbonPage(self._ribbon, WORKPIECE, "Workpiece", Bitmap("eye.xpm"))
page_2 = RB.RibbonPage(self._ribbon, wx.ID_ANY, "New Tab", Bitmap("empty.xpm"))
You need the flag RIBBON_BAR_ALWAYS_SHOW_TABS
try this:
self._ribbon = RB.RibbonBar(self, wx.ID_ANY, agwStyle = RB.RIBBON_BAR_DEFAULT_STYLE | RB.RIBBON_BAR_ALWAYS_SHOW_TABS)

What are and how to use '#' in URLs

In my application I have a layout page for viewing the project:
This page have 4 sub-pages (Details, Photos, addresses and comments).
Example:
/myproject = Open the details page
/myproject/Photos = Open the Photos page
/myproject/Addresses = Opens the page addresses
/myproject/Comments = Open the page of comments
Question
How to use # to load pages via ajax to the URL?
Example
/myproject = Open the details page
/myproject#Photos = Open the Photos page
/myproject#Addresses = Opens the page addresses
/myproject#Comments = Open the page of comments
In page layout where I have four buttons, click on the photo for example, the page would be loaded via ajax. and url go
from /myproject
to /myproject#Photos
Resume
How to use '#' in asp.net MVC?
They are generally called URL fragments and are used as bookmarks on a page to navigate to different sections of that page. When clicked they will scroll down the currently loaded page to the matching tag name. I would recommend against using them as paths to different pages.
You can use them as bookmarks by specifying the fragment in the Htmlhelper:
#Html.ActionLink("My Photos", "Action", "Controller", null, null, "Photos", null, null)
Then in your Photos partial that represents the Photos sub-page, set the html id attribute to "Photos" in the div or label or whatever represents the beginning of the Photos partial. The link created with the #Html.ActionLink will look for a html element ID that matches the word you typed into the fragment.
See LinkExtensions.ActionLink Method for more details.
Sorry, brain fart there... You need everything client side...
I'd use the following jQuery plug-in to parse the URL fragment:
http://benalman.com/projects/jquery-urlinternal-plugin/
and then call MyDiv.Load('yourcontenthere') to load the content you'd like into the desired DIV.

Resources