Profile Data not being parsed.
  • Hello all, 

    Is there currently a fix for profiles not being parsed correctly? 

    I first thought it was just my install, the bug seems to be in the demo as well: 

    Issue: 
    birth_date:1963-07-31
    first_name_public:1  <-----------
    gender:male
    geolocation:Prague
    last_name_public:1  <-----------
    organisation:Canonical Inc.
    website:http://sourcefabric.org

    first_name_public, last_name_public, email_public 

    Seem to be the three fields with the issue of not being parsed correctly.  Any ideas or fixes? 
    Post edited by Rick Wilson at 2012-07-18 18:29:40
  • 10 Comments sorted by
  • Hi,

    this is not a bug, it is just one of two possible values of these switches in user profile - it can be turned on (1) or off (0). Now, of course, template can be improved to check if value is 1 or 0 to return something more intuitive, for example decision should Last name will be publicly exposed or not.

    If you take a look at the template user_profile.tpl, in foreach loop {{ foreach $profile as $label => $value }} you can add these additional clauses, something like

    {{ if $label == "first_name_public" }}
    {{ if $profile['first_name_public'] == 1 }} ....{{ else  }}...{{ /if }}
    {{ /if }}
    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • Do you know if there is a template which already supports the values in the user profile? 
  • There are some commercial implementations, but not yet in sample themes. I will add this as feature request for next version of Sourcefabric sample themes New Custodian and Rockstar.
    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • Reply to @Rick+Wilson:

    As Ljuba is pointing, check the user_profile.tpl file in the root directory of your theme. That's all what we have at this point but it's a good start, as you can change the way the data is presented any way you want. Currently we are not doing any processing, only rendering all data for the profile. In production templates you would use those switches like in:

    {{ if $label == "email_public" }}
        <a href="mailto:{{ $user->email }}">{{ $user->email }}</a>
    {{ /if }}

    ... or something like that depending on your needs.

    We will improve the demo themes, thanks for the input.

    All Best,

  • Thank you for the reply, i appreciate the help. So the version we use ( non-pro/nom-commercial ) some features such as user profiles is not complete at this time ( in the form of template support ). That does clear things up, thank you again.
  • Hi Holman, yes she explained it is only changes which are needed in the templates, i appreciate the examples and will get working on figuring it out - i appreciate your help as well, thank you. 
  • Vote Up0Vote Down Sava TatićSava Tatić
    Posts: 113Member, Administrator, Sourcefabric Team
    Hi Rick, 

    Just to clarify, what Ljuba was calling "commercial" is just a theme implementation we have done for a client. People (Cleints) are free to share their themes or keep them to themselves. 

    Newscoop itself has only one version, which is open source, free as in free speech and free as in free beer.  

    Sava
  • Haha free beer? Do you have any idea what template that is found in?  :0) 

    Indeed, Newscoop is an incredible product, i appreciate all the work that has been done for all of us to use for our immediate purpose.  Thank you for the feedback as well and the hint of free beer, all of a sudden i am getting this urge to buy everyone a drink  :) 
  • Vote Up0Vote Down Sava TatićSava Tatić
    Posts: 113Member, Administrator, Sourcefabric Team
    RE: template, the syntax is rather simple, $gimme->beer->free 

    :)
    Post edited by Sava Tatić at 2012-07-20 05:38:26
  • LOL Sava, foreach $beer->share - You are all incredible!