SobiPro Templating How To…

Posted on Monday, June 20th, 2011 at 11:51 am

I am not against anyone making money from their great work and the developers of SobiPro are no exception.  However I do believe that if you are providing a solution that is supposedly for free that it comes with some basic documentation on how to use the product.  However to access this basic documentation a ‘club’ membership is required which I feel is wrong, but that is only my view, yours may be different.  During my use of SobiPro I have been compiling a list of how to references on using the SobiPro Template framework and the template language (XSL) used.

UPDATE: Yesterday I decided to trial a Club Membership and bought a 1 month membership to see what the documentation was like, and to be honest I was pleasantly surprised and really do believe that a 1 or 3 month membership is worth it as the documentation is very good.  It fills the gap between what I already knew and what I have been trying to work out.  So if you can afford a single months membership I suggest you get it, or better yet a 3 month membership.  The only thing that they need to consider adding is an upgrade path from a Bronze to Silver to Gold which I think will assure ongoing payments by users as they notice the true value of the documentation. 

Anyone that has previously used Sobi2 prior to SobiPro would have seen the great documentation provided on the Sigsiu website of which, through the use of that documentation, many were able to make their sobi2 site look, work and play as they wanted it to, it was what made sobi2 so great.  That documentation gave quite detailed descriptions, guides and examples on how to create, edit and customise the templates used for the front end of the Sobi2 system.  Unfortunately that information is not being provided for SobiPro unless you obtain a SobiPro Club Membership with a minimum cost of 30 Euro for a single months access.  The developers have decided that any and all documentation is only provided via a Club Membership. that is fine and that is their choice, but I feel the basic documentation should be provided freely with SobiPro just like it was for Sobi2.  Please do not take me the wrong way of not supporting developers for their work, I have bought quite a few add-ons for the previous sobi2 solution and would have again with SobiPro if it went down that same path.

So anyway while starting to use SobiPro I have been compiling my own set of ‘template’ guide notes for SobiPro so that I can refer to them when I need to for any other future SobiPro sites.  This list is not exhaustive and only covers those template functions I have needed so far and therefore is not a complete list of template functions and how to’s.  I am also not an XSL expert by any stretch of the imagination but I am learning thanks to SobiPro.  I also need to point out that all of the information has been gathered from actually using SobiPro with some trial and error to see the end results.  Much of the detail is actually freely available from within the included templates (vehicle section template) of the base SobiPro install, you just need to know where to look.  I have not yet purchased a Club Membership so I have no access to any of that documentation, even if I did I would not divulge the content that is beyond the basics of SobiPro core as that would not be right.  I need to be clear that I am not seeking to take anything away from the SobiPro developers, but rather help other SobiPro users too understand how the template system works and hopefully it will enable them to better utilise SobiPro, just as we were able to do with Sobi2.  If of course the SobiPro developers decide to make the core documentation that contains what I have below and more public, then that is great and is in my view what should have been done in the first place..

Please also note the following is from my own use and testing, there may be more efficient ways of doing some of the below which I have yet to discover and test.  If you are a SobiPro user feel free to submit additions to this post, but please if you have bought a membership do not provide any non core documentation content as that is what you (and others) should be paying for to support the ongoing development of sobi* in general.

Please, I need to be clear here that I am not out to be destructive or negative towards SobiPro or Neo and Trinity at Sigsiu.net.  Far from it, I would like to support it more if I could and I hope by helping others that I am doing just that and not simply seen as being ‘destructive’ as Neo has mentioned here.  I would be very happy to buy a Club Membership ‘IF’ the price for that membership was more reasonable.

The Basics:

Differences between Vcard and Details view

When looking to insert fields into the vcard and the details view there is two small differences between the two.

For vcard view the fields are added by simply prefixing the field you want with field/

For the Details view you need to prefix the fields with entry/field

Some of this is shown below in the examples provided.

Getting a field label:

On the Card view;

  <xsl:value-of select="fields/field_NAME/label" />

On the Details view;

  <xsl:value-of select="entry/fields/field_NAME/label" />

The field_NAME is the actual field name that you wish to have the label for.

Adding text within a field area:

Surround the text with the following code

  <xsl:text>YOUR TEXT</xsl:text>

Where YOUR TEXT is any text you want displayed in or around the field label or field data.

Displaying a fields data:

On the Card view;

  <xsl:value-of select="fields/field_NAME/data" />

On the Details view;

  <xsl:value-of select="entry/fields/field_NAME/data" />

field_NAME is the field to which you want the data displayed

Displaying an Image field:

For a single image in the vcard use the code

  <xsl:copy-of select="fields/field_item_main_image/data" />

For a single image in the detail sview use the code

  <xsl:copy-of select="entry/fields/field_item_main_image/data" />

Where field_item_main_image is the name of the image field you want displayed.

Display a web site URL field as a link (updated).

The field label is of course optional.

For the Card view

  <xsl:value-of select="fields/field_web_site/label" /><xsl:text>: </xsl:text>
  <a>
    <xsl:attribute name="href">
      <xsl:value-of select="fields/field_web_site/data/a/@href" />
    </xsl:attribute>
    <xsl:value-of select="fields/field_web_site/data" />
  </a>

For the Details View

  <xsl:value-of select="entry/fields/field_web_site/label" /><xsl:text>: </xsl:text>
  <a>
    <xsl:attribute name="href">
      <xsl:value-of select="entry/fields/field_web_site/data/a/@href" />
    </xsl:attribute>
    <xsl:value-of select="entry/fields/field_web_site/data" />
  </a>

Where field_web_site is your web site field.

Conditional Publish Statement:

If you wish to check a value and if correct publish or if not then not publish the code is simply

For vcard;

  <xsl:if test="fields/YOURFIELD/data = 'THEVALUE'">
    <xsl:value-of select="fields/YOURFIELD/data" />
  </xsl:if>

For Details;

  <xsl:if test="entry/fields/YOURFIELD/data = 'THEVALUE'">
    <xsl:value-of select="entry/fields/YOURFIELD/data" />
  </xsl:if>

The value is whatever you want to check if something is equal to it, for example is the field equal to 100, you would add 100 in the THEVALUE location.  Take note also that there is no elseif in XSL, you can use otherwise (shown in next how to example) or you can nest additional if statements if you want it to check for more values.

Outputting content without html being shown:

In the xsl value section add the following after the field data

  disable-output-escaping="yes"

so for example on the card view use

  <xsl:value-of select="fields/field_item_detail/data" disable-output-escaping="yes"/>

Or on the details view use (though I do not think you need to for the details view, but here it is anyway)

  <xsl:value-of select="entry/fields/field_item_detail/data" disable-output-escaping="yes"/>

Truncating a fields output:

  <xsl:choose>
  <!-- if YOURFIELD is greater than the MAXLENGTH -->
    <xsl:when test="string-length( YOURFIELD ) &gt; MAXLENGTH ">
      <!-- print out the truncated value followed by "..." -->
      <xsl:value-of select="substring( YOURFIELD ,0, MAXLENGTH )"/>...
    </xsl:when>
    <xsl:otherwise>
    <!-- otherwise print out the whole, un-truncated string -->
    <xsl:value-of select=" YOURFIELD "/>
    </xsl:otherwise>
  </xsl:choose>

Replace YOURFIELD with the field name that you want to have truncated, e.g. fields/field_item_detail/data

Replace MAXLENGTH with the maximum length of the output you want, e.g. 80.

Show more than 15 sub-categories:

If you want to show more than the max subcategories set by the sections General Configuration simply open up the your SobiPro template folder and locate the common/category.xsl file and edit line 28

Change the +1

  <xsl:if test="position() &lt; ( $subcatsNumber + 1 )">

to whatever number you want it to be, e.g. + 30

  <xsl:if test="position() &lt; ( $subcatsNumber + 30 )">

Now up to 45 sub category items will display (if you selected 15 in the General Configuration)

Choosing one value over another, conditional result

This is useful if you want to test a value to have a value and if not then use an alternative value.  For example if I want to check to see if the listing is in a US State I can have two fields, one for US States (field_state) and one for Non US States (field_non_us_state).  I have a select drop down box for all US states, but also one for Non US State. When a user enters their record they can enter either the US State or they can select Non US State and then enter the non US State in the field provided (field_non_us_state).  Now I want to show the correct data for that record, being either the US state or the Non US State, to do this and to cover both options I can have something like this.  Remember the field display differences between Card view and Details view shown above.

  <xsl:choose>
    <xsl:when test="fields/field_state/data = 'Non-US-State'">
      <xsl:text>, </xsl:text><xsl:value-of select="fields/field_non_us_state/data" />
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>, </xsl:text><xsl:value-of select="fields/field_state/data" />
    </xsl:otherwise>
  </xsl:choose>

The above will check via a choose command to see if the first value is correct and if so it will apply that data, if not it will then move to the next option and that being the US State. It is kind of like an IF statement but less messy as it will choose the correct result.

Adding the Category Name to the page heading (content).

When you view a page within your SobiPro front end you will see the section name as the component heading name on all pages, while this is good I wanted to also add the category name to that title as well.  So instead of just having Business Directory at the top of the page I can now have Business Directory – Category Name.  It is very simple to do.

In your template folder and the category folder select the view.xsl file and add

   - <xsl:value-of select="name" />

after

  <xsl:value-of select="section" />

to end up with

  <xsl:value-of select="section" /> - <xsl:value-of select="name" />

The Result will be your SobiPro Section name and then the Category name.

If you want the same also added to an entries details page (entry/details.xsl), the code for that is slightly different, add

   - <xsl:value-of select="entry/categories/category" />

after

  <xsl:value-of select="section" />

so you end up with

  <xsl:value-of select="section" /> - <xsl:value-of select="entry/categories/category" />

Now you will have the Section and category name displayed on the top of the page.

Outputting the date of entry or date of update in a format you want.

I wanted to display the date an entry was added and last updated which is easily done by using the following (for details page)

  <xsl:value-of select="php:function( 'SobiPro::Txt', 'Date added' )" />:<xsl:text> </xsl:text>
  <xsl:value-of select="entry/created_time"/><xsl:text> | </xsl:text>
  <xsl:value-of select="php:function( 'SobiPro::Txt', 'Last time updated' )" />:<xsl:text> </xsl:text>
  <xsl:value-of select="entry/updated_time"/>

However the output of the date comes out like this 2011-08-09 00:00:00

I wanted it to only show the date and as date/month/year, to do this I was able to change the date format by using the built in FormatDate function, like this

  <xsl:value-of select="php:function( 'SobiPro::FormatDate', 'd/M/Y', string(entry/updated_time) )" />

You can use different date formats by using the correct date codes for php found at http://php.net/manual/en/function.date.php.

Note if you want to add the dates to your vcard you will need to change;

  string(entry/updated_time)

to

  string(updated_time)

Replace the jquery modal box with mootools slimbox.

For unknown (and quite frankly a poor decision) reasons Sigsiu has implemented jQuery for its javascript requirements over mootools which is the preferred javascript framework for Joomla.  Having jquery also as part of your site on top of mootools can cause conflicts and result in unpredictable outcomes and output to your web site.  So I am on a path to remove jquery from SobiPro completely, but this is the start, the thumbnail to full size image view in the entries details page.

The example provided to start me off is what is provided in the ‘vehicles’ template, the code for the modal jquery pop up image is written as

  <div style="float: right;" id="SPGallery">
    <a class="modal" >
      <xsl:attribute name="href">
        <xsl:value-of select="entry/fields/field_image/data/@original"/>
      </xsl:attribute>
      <xsl:copy-of select="entry/fields/field_image/data/*" />
    </a>

You will need to edit the details.ini file and replace

  js_files = "jquery,details,box"

with

  js_files = "slimbox"

and replace

  css_files = "default,details,box"

with

  css_files = "default"

Now the code I am using in my details.xsl file to replace the modal one (shown above) is the following, you can style it differently if you want;

  <div style="float: right;">
    <a rel="lightbox">
      <xsl:attribute name="href">
        <xsl:value-of select="entry/fields/field_entry_image/data/@original"/>
      </xsl:attribute>
      <xsl:copy-of select="entry/fields/field_entry_image/data/*" />
    </a>
  </div>

The @original is what is used to create the link to the original file. this is what is shown when the user clicks on the thumbnail image.  Ensure that in your SobiPro field for your image that you have set the thumbnail to be shown as default in the details view.

You will also need to obtain slimbox – get it from http://www.digitalia.be/software/slimbox but remember that slimbox2 uses jquery, so get slimbox 1.7x.

I then copied all of the slimbox css and placed it into the default.css file for my Sobipro template, and likewise copied the images into the css folder as well.  I copied the slimbox.js file to the js directory of the template I am using, which you referenced already above.  Save it all.

That should be it, test your SobiPro front end and details view to check that it is working for you.

Setting a Default Category for those sections with only one category

Thanks to KST for help in working out this solution

First identify the ID of the category you will use as your default.

Add this line just after the last div in the default template / entry / edit.xsl file, where XX is your default category.

<input type="hidden" name="entry.parent" value="62" id="entry.parent"  />

Then delete lines 26 to 46

<div>
  <div>
  <label for="entry.parent">
    <xsl:value-of select="php:function( 'SobiPro::Txt' , 'TP.CAT_BOX' )" />
  </label>
  </div>
  <div>
  <xsl:copy-of select="entry/category_chooser/path/*"/>
  <div style="clear:both;"/>
  <div style="float:left; display:none;">
  <xsl:copy-of select="entry/category_chooser/selected/*"/>
  </div>
  <div style="float:left;">
  <button type="button" name="parent_path" id="entry_parent_path">
  <xsl:value-of select="php:function( 'SobiPro::Txt' , 'EN.SELECT_CAT_PATH' )" />
  </button>
  </div>
  <div style="clear:both;"/>
  </div>
  </div>
  <div style="clear:both;"/>

Save and test.

Adding alt and title text to an image

When developing your site you should always ensure that you use an ‘alt’ and ‘title’ tag for all of your images.  SobiPro however does not provide this by default so you need to build that into your template;

Lets say for example you want to have a main image on your entries details page, first you need to create the image field, lets just call it ‘field_my_image’ for this example, here is how the code needs to look to enable it to use an alt and title tag

<img class="spFieldsData">
  <xsl:attribute name="title">
    <xsl:value-of select="entry/name" />
  </xsl:attribute>
  <xsl:attribute name="alt">
    <xsl:value-of select="entry/name" />
  </xsl:attribute>
  <xsl:attribute name="src">
    <xsl:value-of select="entry/fields/field_my_image/data/img/@src" />
  </xsl:attribute>
</img>

What we have done here is split up the img src code into segments so we can control what is used and how it is displayed. For the ‘alt’ and ‘title’ tags I have chosen to use the entry name field, you can of course use another specific field if you want.  As can be seen I have set a value for the title, the alt and of course the image itself,  The end result is your image is displayed and now includes alt and title in its source.

The same can also be done for the vcard view, you simply need to remove the entry/ part of the fields code, so that would look like this;

<img>
  <xsl:attribute name="title">
    <xsl:value-of select="name" />
  </xsl:attribute>
  <xsl:attribute name="alt">
    <xsl:value-of select="name" />
  </xsl:attribute>
  <xsl:attribute name="src">
    <xsl:value-of select="fields/field_my_image/data/img/@src" />
  </xsl:attribute>
</img>

Nice and Easy 🙂

Showing a field only if it contains data.

This is a variation of the check for specific data as I have provided above, but since this was asked for specifically here is the way to do it.

Basically what you are about to do is simply check that the field contains data, if it does then show the field (and other data linked to it) otherwise do not show that field at all.  This is a basic IF statement that checks for a null value.  This example uses a filed named ‘field_name’ just substitute that for your field.

In the vcard view

<xsl:if test="fields/field_name/data != ''">
  <div>
    <span><xsl:text>Field Name: </xsl:text></span>
    <span><xsl:value-of select="fields/field_name/data" /></span>
  </div>
</xsl:if>

In the Details view

<xsl:if test="entry/fields/field_name/data != ''">
  <div class="spField">
    <span class="label"><xsl:text>Field Name: </xsl:text></span>
    <span><xsl:value-of select="entry/fields/field_name/data" /></span>
  </div>
</xsl:if>

Simple hey 🙂

… more to come as I use SobiPro more and more

Oh if you want to post some code for me to see what issues you are having use the code button and then use ‘&lt;‘ in place of  ‘<‘ and ‘&gt;‘ in place of ‘>’

 

Comments are now closed on this topic.  I am no longer using SobiPro due to the costs to keep it updated with the extensions.  If and when Sigsiu provide a better price system for their product I may revisit this but not at this time.

Share

Tags: , , ,

201 Responses to “SobiPro Templating How To…”

  1. dglite Says:

    this had been very useful, thanks!

  2. Greg Says:

    There is a way to do this within the template code, have a look at my post and the code provided above in my post for clues. My count is used for categories but the same can be applied to entries. I will get the code for you later and edit this reply and my post above with the answer :). Stay tuned 🙂

  3. Greg Says:

    Sorry I have not replied sooner as I have been ill and this often takes days to recover from. I will take a look at your request soon and reply with a solution if I find one.

  4. Greg Says:

    Sorry I have not replied sooner as I have been ill and this often takes days to recover from. I will take a look at your request soon and hopefully have a reply for you soon

  5. Greg Says:

    Hi take a look at the code that SobiPro generates and utilise the classes provided to adjust how the details look. like spfield for example you can apply a specific css for that to style it the way you want. This is far better than adding paragraph tags in the front end code for the output. To view the code and the styles used may I suggest you use Firefox with Firebug installed to see the code for any and all elements on your site.

  6. jose Says:

    hi, is there possibilitie to show a field if it has data and don´t show it (even it´s label) if it does not exist?

  7. jose Says:

    hi again, how can I add an alt text and title to an image a sobi pro entry image?

  8. Greg Says:

    See the post above, I have now included the answer to your question in my post 🙂

  9. Greg Says:

    Simple enough, I have now included that answer in my post that has been updated above.

  10. jose Says:

    hi again, I´ve written sometimes because I´m looking for something

    Once I asked to have a listing of items listed by image, being the key field the name field) I´ve got it

    take a look http://www.opticos-optometristas.com/foro/memberlist.php?mode=viewprofile&u=1805

    simply configuring the field to be shown in vcard and details

    now I want to have an alt and title with the image, the answer you provide, does not work for me, sorry

    any other way to achieve this

    thanks in advance

  11. jose Says:

    sorry the URL is incorrect, this is the correct one

    http://www.opticos-optometristas.com/index.php?option=com_sobipro&sid=65&Itemid=196

  12. speedy Says:

    Hi, Greg

    Thank you for this great site! I think we should start a “unofficial support forum” for all “non-sobiproclub-members”. What do you think?

    Cheers

  13. Liam Says:

    Hi Greg,

    Great work here, found some of the things useful. I do have a query though. I am not too technically minded, I am more of a designer but I have been tasked with building a directory. I am using SobiPro’s Business Directory with Packages template. My issue is that I want to style the vCard however the elements I edit in the vCard are affecting those same elements in the Detailed View.

    I am editing the default class of “spField” but obviously this is the class for fields in both vCard and Detailed View.

    How do I go about changing the class names within the vCard view so I can style this differently?

    Any help here would be greatly appreciated.

  14. Greg Says:

    Hmm, not sure why yours does not work with the code I have provided. I have this working on a SobiPro install with 10 sections and all are working properly. It may be a conflict with another plugin or similar. Have you tried the code within a copy of the default template?

  15. Greg Says:

    Sorry no about the forum, it is better to keep forum discussions at sigsiu.

  16. Greg Says:

    Yes the style sheet classes affect both the vcard and the details view. For the css you can prefix every style for the details view with #SPDetails so for the spField for the details use #SPDetails .spField {} in your css file. Just remember to use the #SPDetails .spField {} after the default spField entries.

    To edit the actual vcard template you will need to have a look at the /common/vcard.tpl file, likewise for the details view have a look at the file entry/details.tpl. Both are located in the \components\com_sobipro\usr\templates\templatenmame directory.

    Hope that makes it clearer

    GW

  17. Greg Says:

    Can you send me your template as a zip file so I can take a look and maybe see the code that is causing the issues? Use my contact form on this site.

  18. Liam Says:

    Hi Greg,

    Thanks for the tip on styling vcard separate.

    I’ve encountered another problem that I just can’t get my head around and was wondering if you or anyone else had encountered it.

    When I use the default template, the edit entry button on the front end works perfectly fine. However when I switched to the business template with packages the edit entry link appears in the url bar however the page is blank…..

    It’s got me tearing my hair out.

  19. Losa Posta Says:

    Is this posible when in section let say hotels we have categories 3* 4* 5*

    and when i get in3* i gel list of hotels, click on name we get detailed info, and in some template
    Start Prev 1 2 3 Next End like a pagination

    but can we below that have rest of the entries from that category as a table of content (no pagination needed), we want to have it built in template not as a module. Can sobipro achieve that not sobi 2

    Please someone

  20. Sergey Says:

    Could You please answer me how I can show Icon of image field?
    @original – is for original image. What query need using for Icon of this field?

    Thanks!

  21. Maria Says:

    I hope your health is better. Thank you for creating this entry on your website.

    I’ve been pulling my hair out with SobiPro for three days. I’m at a crossroad where I need to decide if I should invest more time into it or scrap my losses. Unfortunately there isn’t a competing Joomla addon at this time. I’ve thought about buying JReviews just for the modern design and seemingly ease of usability.

    I haven’t purchased their club membership. I’m undecided as I don’t know xml and don’t know if I want this frustration right now over a directory website. It is also scatter to read many purchasers got no resolve after buying. Their price is too expensive. I think they are failing to see their mambership is not a complete time saver. I don’t mind buying products for Joomla but as a designer I want to pay for convenience also.

    Anyway…have you been able to figure out pricing plans? I’m trying yo wrap my brain around it. Does it create duplicate directories in the frontend? Was it a seamless process?

  22. Maria Says:

    …grammatical errors due to my Kindle failing to read my mind correctly.

  23. raz Says:

    hi
    Please help me.
    How can we to display the entries on an author?

  24. Cartman Says:

    Hi Greg. You seem great at Sobipro and I have a problem that I haven’t found any answers to. I feel stupid because googling doesn’t show that anybody else have the same problem.

    I have the following configuration: section/category/subcategory/entry (sometimes there may be yet another subcategory)

    In the main section view I see the vcards for my entries.
    In the category view there are no vcards.
    In the subcategory view I see the vcards again.

    Why dont they show in the category view?
    Link http://ambiductor.com/en/products

  25. Len Renda Says:

    Hi there, thanks for a very informative site into the guts that make Sobi work.

    I am trying to change the details view, but not the actual layout of the page itself, but rather wish to break up the info of the listing itself, which is all “squished” up, if you know what I mean.

    I would like to put in a couple of breaks between the info, for example, have a before the field “Areas of Expertise:” and “Qualifications”, etc.
    I would also like to add headings like “Contact Details” above the contact fields.

    However, when I view entry/details.xsl or try finding looking into common/entries.xsl, it does not show the fields as I would see them if I was on the details page and selected to view the source, where I can see all fields in the entry listed individually.
    From what I can see with my limited knowledge of XSL, based on line 7 in the details.xsl called entry_details, and line 17, for each…entry/fields, it currently just pulls them globally.
    I assume I will have to write in each field, pulled from the entry based on the listing name or number and apply the format I want to have.

    Hope it all makes sense.
    Thanks in advance
    Len

  26. Len Renda Says:

    Sorry , I see code is stripped ( I knew that, but forgot)

    In the following line, there was a “line break” at the ……

    I would like to put in a couple of breaks between the info, for example, have a …… before the field “Areas of Expertise:” and “Qualifications”, etc.

    Thanks
    Len

  27. Greg Says:

    Just a quick note to everyone, Sorry I have not been around to reply to your questions, I have not been well. I will try and get to them over the next week.

    Thanks

  28. Len Renda Says:

    Hi Greg
    The questions posed here are not in the least bit important in the bigger picture!
    Given the fact that you are dealing with health issues, I am amazed that you even apologize for not responding!
    I understand you passion (I can see it on this webpage) but your health and family come first.
    Wishing you all the best, and that you recover as speedily as possible.
    Ignore all of us and concentrate on your health.
    PS. While writing this reply, I was again browsing through previous posts and found what I was looking for, so ignore my previous posts.
    Thanks and God bless.
    Len

  29. Greg Says:

    Thanks Len for your kind words.

  30. Greg Says:

    Liam, firstly can I make a very strong recommendation and that is NOT to use any of the default templates. If you want to use either of them, make a duplicate of one of them and edit the template xml file and call it something else. Once you have a template you are happy to use then you can ask for some specific help, also state if you want help with the vcard or details view. It could be pointless for me to suggest changes to one or the other default templates when you decide to use a custom one. I hope that makes sense. Either way the edit button will be placed where you see the code for

    vcard view

    or for details page

    You can place that in any location you want it to be displayed on your template

  31. Greg Says:

    am not really sure what you are asking, is it that you want other entry vcards displayed on the details page of a single entry? If so it is not something I have done, but I do think it could be achieved by adding some specific code from the section view to the details view. Sorry I cannot specifically provide that code as it will take some considerable time to work that out and provide it. Personally it is not what I thin you should do – but that is just my opinion.

  32. Greg Says:

    Hi Sergey, use one of the following depending on your needs, the …data is the usual access like fields/fieldname/data

    …data/@icon – for icon
    …data/@image – for image (re-sized original via your settings)
    …data/@thumbail – for thumbail
    …data/@original – for original

    Hope that helps

  33. Greg Says:

    Maria, sorry I am not really sure what you are asking, can you be more specific please.

    In relation to SobiPro membership I believe it is worth getting at least a one month membership to which you should use extensively and ask for help in the SobiPro forums as the developers can provide more help than I can. It will also give you access to the documentation that is actually quite good and very helpful… longer access to the documentation can be achieved if you are clever enough 🙂

  34. Greg Says:

    Are you asking for Sobipro to show all entries for a specific author? Yes this can be achieved, the answer however is quite long to put into a comment, so I will add it to the main post later for you, give me a couple of days to get to it :). Alternatively you could become a SobiPro Member and see the answer in the Tips and Tricks forum.

  35. Greg Says:

    This is by default entries are not displayed on categories. You could however have a look at the code in the sections view and try adding something similar to the category view. Or alternatively use a SobiPro module to show the entries on the Category view by also using something like modules anywhere and place the module in your sections general section description. There is help in the SobiPro documentation for this but I cannot share that here as it would not be right.

  36. Len Renda Says:

    Hi Greg
    I hope this inquiry finds you in much better health. Me, I am really losing it here!

    I have tried just about everything I can think of, and then some!

    This post on the Sigsiu community forum… mentions the AIContactSafe component which can be used to add a contact form onto the Sobi listing
    The code in this topic (https://forum.sigsiu.net/community-board-for-sobipro-discussions/contact-form-36196/10/) mentions

    11. Place the plugin code in your Sobipro details template: (note: the pf=3 is your form profile id)

    {aicontactsafeform pf=3|use_css=1|aics_recipient_email=|aics_subject=}

    If I paste the below code in a new article, it works fine. (see test under module “recent articles of interest”) on http://www.myadvisor.co.za

    Yet everything I try to get the contact form to show on the end of the listing will not work.
    Obviously I am doing something wrong!!!! I just cant figure out what!!

    In the listing, I even tried it by created a new field, and setting it up as follows: text area, allowing html with no filters, parse content.
    I then edited an entry, and in this new field, I pasted the above code, but still no contact form!

    I tried alternating between the setting in section config/general config/ template data/parse template data=yes/no, and the parse content=yes/no in the field properties, but still no joy!

    I tried pasting the following:

    into various locations in the details.xsl, but it either broke it, or reflected some of the code directly, or did nothing!!
    This is driving me TOTALLY nuts!! Can anyone help before I land in the looney bin!!!
    Len
    PS. I will check after publishing if all the code gets stripped again.

  37. Len Renda Says:

    Ok, code stripped again 🙁

  38. Greg Says:

    Len, try using the following when adding your code,

    < for all < and > for all >

    Do a replace in your code and then post the code again.

  39. Len Renda Says:

    Hi Greg
    Thanks for the prompt reply.

    Currently, the field just display 3 dots (below the “about us” field) and I am not sure if that means something?
    Could you perhaps have a quick look?
    If I inspect it with firebug, it does show a div id reference to AISafeContact forms, but just 3 dots between the opening and closing div’s

    PS. The code you suggest I add, is this in the field I created, or if I paste the code directly in the details.xsl?

    Thanks
    Len

  40. Len Renda Says:

    Hi Greg
    Unfortunately no luck with the above additions to the code 🙁
    Thanks anyway
    Len

  41. raz Says:

    Hi Greg
    I found how to show all entries for a specific author in this link:

    https://forum.sigsiu.net/community-board-for-sobipro-discussions/%28how-to%29-display-a-user-listing/msg123540/#msg123540

    I want when I click on title of entry, It goes to my entry. But here it goes to section.

  42. raz Says:

    Hi
    Is it possible that we have two different styles for vcard and entry?

  43. xCyC Says:

    Hi,

    First thanks for this amazing tutorials! But can you explain how to you use Sobipro Tabs? I missed that one!

    Keep up the great work!

  44. urmitnick Says:

    Hi Greg,

    First of all, thank you for this great work. And I hope you are fine!

    I’m trying to customize my “edit.xsl”, I followed what you said in the comment dated (February 3rd, 2012 at 9:33 am):

    I removed everything from between : and , and I added:

    Lable Name:

    replacing field_name by the fields that I want to show.

    The problem is that only the label appears and the input boxes or the select lists… doesn’t appear!!!
    can you help me with this problem?

    Regards,

  45. Christoph Says:

    Thanks for your efforts and extensive work here. I just installed subipro. I agree, some basic documentation whould be provided. And here is a real “dumb” question. I have both the “Business Directory” and “Cars & Vehicles Marketplace” Sections enabled. However, only the Business Directory Tab appears. I cannot for the life of me figure out how to make the “Cars” visible for site members. This is so basic…Any help would be appreciated.

  46. T.C Says:

    If someones wants to keep the “old” layout for spField in details view for “Showing a field only if it contains data” solution I have made a little change in the code..

    :

    I just replace this Field Name: with this :

    Thank you for this post Greg..

  47. Ali Says:

    Hi there, thanks for an important tutorial. Can anyone please tell me how to add counter (number of entries in a category) in front of categories on the main page? Which files I need to change. Thanks
    Cheers, Ali

  48. Anneliese Fox Says:

    Someone else asked how to test if a user is logged in. There may be better ways, but this is how I did it:

    Add a new function to template.php:

    public static function GetUser ()
    {
    // returning the user id lets me know that the user is logged in,
    // if not logged in, then user id will be 0
    $user =& JFactory::getUser();
    return $user->id;
    }

    Modify your template (in this case vcard.xsl)… In this example I am simply trying to change a message that is displayed:

    <xsl:variable name=”userid”>
    <xsl:value-of select=”php:function( ‘TplFunctions::GetUser’ )” />
    </xsl:variable>

    <xsl:choose>
    <xsl:when test=”$userid > 0″>
    <xsl:text>More Details </xsl:text>
    </xsl:when>
    <xsl:otherwise>
    <xsl:text>Login for Details</xsl:text>
    </xsl:otherwise>
    </xsl:choose>

  49. Morris Says:

    Hi there,

    First of all, congrats for this site and for the comments/answers zone!! They have been great and i’ve just accomplished to put sobipro 100% working with yout help! 🙂

    I’m now having one issue since I want to use 2 diferent sections with the sobirestara template … the first section is all working correctly but the 2nd section is giving some problems .. I’ve made a copy of the first section and then I’ve added exaclty the same fields with the same field names but it does not load the contents correctly … The tabs are loaded correctly but the contents not .. It appears the info but the map does not load (only when adding an entry), the images appear plain and simple .. (it appears that the css and the js are not loaded beacuse in the gallery the images appear normal and all followed up)… Can you help me solving it?

  50. Paul Says:

    Thank you Greg, your insight on SobiPro is very helpful, I’m new to it and you helped shed some light. Keep up the good work.