Profile View Templates/PFBLOCKs

I am trying to edit the layout of the profile view page as far as the template and the PFBLOCKs that are on that page.  I see a table is generated for each of the PFBLOCKs; where is it generated? I must not be thinking correctly on this because so far I have gotten nowhere.

Geeks, making the world a better place
Quote · 23 Nov 2013

In the database, the content field holds a number, such as 69, 74, 79, 104 etc.  What does that mean?

Geeks, making the world a better place
Quote · 23 Nov 2013

The number is just a ID. It is stored in sys_page_compose in the Content field. That's how dolphin looks up the id of the fields that are to be displayed in that block.

Now the profile fields are stored in sys_profile_fields and you will find that number in various columns for each field that is displayed for that block. Fields such as the ViewMembBlock which i believe is the block shown on the profile page. To be honest i don't know what most all of those columns represent. But i also have never had a need to know.

When you move a profile field in the fields builder from one heading column to another it changes that number which determines which profile fields block it is shown in.

Anyhow. I don't see why you would even need to know this. What could you possibly be needing those numbers for? I do not see any way they could be related to a template. I used to make templates before 7.1. I have never had a need for that information to design a template.

Perhaps if you explain what your trying to do.


The code that actually generates the block and the content is in two functions in templates\base\scripts\BxBaseProfileView.php

Those functions are...

function showBlockPFBlock
function getViewValuesTable


https://www.deanbassett.com
Quote · 23 Nov 2013

Yes, Dolphin uses the term template in more than one way.  I am not talking about the site appearance template, the tmpl_Template-Name thingy but the template files used to lay out various bits of Dophin, such as _header.html, _footer.html, album_unit.html, etc..  Those are also template files, correct?

Let's look at the Contact Info PFBlock that appears on the profile view page since that is the one I want to start with.  Now, that block has a table, two columns; left side with the name of the field, the right column holding the content of the field.  Now somewhere in Dolphin there is code that says, I want that PFBlock to be a table.  I will admit that I have much to learn about Dolphin.

Now, the main point of me learning is that I want to add the mailto around the email address making it so a member can click it and open up their local email client.  Now I think I see where it reads in all the profile data from the database for a particular member ID but I don't know where or how it is building the PFBlock in the Profile View for the Contact Info Block.  I am trying to figure how where would be the best approach for wrapping the email address in a mailto link. 

I think I often approach things from too complex of a view but hopefully as I blunder along I can improve my understanding of Dolphin.

Geeks, making the world a better place
Quote · 24 Nov 2013

Ok.

Well that will be a bit difficult. Dolphin uses the formview function to display the data. At the end of one of those functions i pointed out are these two lines.

$oForm = new BxTemplFormView($aForm);

return $oForm->getCode();

Everything before that is the code that preps everything to be passed to the formview function which generates the tables you see. All of dolphins forms have that same layout.


I'll see if i can figure out where to tap into that to change it.

https://www.deanbassett.com
Quote · 24 Nov 2013

I tried manipulating the data in function getViewValuesTable($iPageBlockID, $iPFBlockID)

Instead of displaying it as HTML code, it displayed the HTML mailto: code as text; so no go with that angle.

AntonLV has a search module in the market where he turns the fields in the profile view into search links; so he probably could help with my understanding.

Geeks, making the world a better place
Quote · 24 Nov 2013

I have found a way around that. Code to follow.


https://www.deanbassett.com
Quote · 24 Nov 2013

Edit templates/base/scripts/BxBaseProfileView.php

In the function getViewValuesTable at about line 292 look for this line.

                if ($sValue1 || $aItem['Type'] == 'bool') { //if empty, do not draw

Insert this above that line.

                $bPreserveHtml = false;

                if($aItem['Name'] == 'Email') {
                    $sValue1 = '<a href="mailto:' . $this->_aProfile['Email'] . '">' . $this->_aProfile['Email'] . '</a>';
                    $sValue2 = '<a href="mailto:' . $this->_aCouple['Email'] . '">' . $this->_aCouple['Email'] . '</a>';
                    $bPreserveHtml = true;
                }

                if($bPreserveHtml) {
                    $sDbValue1 = $sValue1;
                    $sDbValue2 = $sValue2;
                } else {
                    $sDbValue1 = $this->oPF->getViewableValue($aItem, $sValue1);
                    $sDbValue2 = $this->oPF->getViewableValue($aItem, $sValue2);
                }

Now look for this line.

                        'value'   => $this->oPF->getViewableValue($aItem, $sValue1),


Change to this.

                        'value'   => $sDbValue1,


Look for this line.

                        'value'   => $this->oPF->getViewableValue($aItem, $sValue2),

Change to this.

                        'value'   => $sDbValue2,


Thats it.

https://www.deanbassett.com
Quote · 24 Nov 2013

Thanks Deano; you do know your Dolphin coding.  I will write this up as a tip and contribute you for the solution since someone else might want to make this change.  The other change was removing the edit link on the blocks and I found that easy enough and simply comment out the bits leaving it as array(),  I did learn a few things more about Dolphin.

Geeks, making the world a better place
Quote · 24 Nov 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.