Textpattern CMS support forum

You are not logged in. Register | Login | Help

#51 2010-05-17 16:54:21

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 985
Website

Re: smd_bio : store additional biographical info about your users

Update: The problem manifests differently when smd_bio is disabled, but it persists. If you continue to ponder this problem, I reckon it falls under the “TXP developer” role instead of “plugin author”.

Although I can delete the specific author above without any problems, when I begin to delete other duplicate imported MT authors, I eventually get the same result, requiring me to restore the DB.

Offline

#52 2010-07-07 10:06:48

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: smd_bio : store additional biographical info about your users

OMG!
You’r TXP GOD!!
Amazing plugin!

Last edited by Katalonian (2010-07-07 10:07:20)


<txp:txp_me />

Offline

#53 2010-07-19 09:26:26

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,223
Website

Re: smd_bio : store additional biographical info about your users

Stef,

When creating an image item, the “size” value is simply to give the image a size in the Users panel, right? It’s not intended to define the size of the image as it should appear in the frontend, right?

At first I thought the intention of size was to actually define the image size as it would appear in the site, but that doesn’t seem to be the case. I’m fine with that, and my CSS does the job as usual, but I just want to make sure I understand the function.


The text persuades, the *notes prove。

Offline

#54 2010-07-19 09:32:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,754
Website

Re: smd_bio : store additional biographical info about your users

Destry wrote:

When creating an image item, the “size” value is simply to give the image a size in the Users panel, right?

Correctamundo.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#55 2010-09-09 09:50:55

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,223
Website

Re: smd_bio : store additional biographical info about your users

New question…

Is there a way to do a conditional check on a given bio field?

In this case, some users are board members having bio articles, and some users are just guest authors. In the case for board members, the article form is designed so that their headshot thumbnail and name are links to the biography articles. This is setup in smd_bio.

However, as it is now if a user does not have a bio, a link is still added and is broken, naturally. I’d like some kind of conditional solution so that if no biography link/title is provided in the smd_bio profile, no link is addeded to the photo/name at all.

The only way I can think to do this is with a conditional wrapper on the block of smd_bio form data, but I’m blanking on how that might be.

Is it possible? A simple hypothetical example I might run with?


The text persuades, the *notes prove。

Offline

#56 2010-09-09 10:23:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,754
Website

Re: smd_bio : store additional biographical info about your users

Destry wrote:

Is there a way to do a conditional check on a given bio field?

Currently not natively but I could try and add a conditional tag that might help. I’ll see if I can figure out how you set your system up from your post and mess around with some solutions on my dev box.

For now you can try a variation on the TXP:variable dance which might get you out of the hole.

Last edited by Bloke (2010-09-09 10:24:30)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#57 2010-09-09 10:59:33

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,223
Website

Re: smd_bio : store additional biographical info about your users

Stef, maybe this will help. :)

The relevant pieces of the profile fields setup in admin-side:

Name | Title | Type | Size | Value | Position

teamrole | Team Role | – | – | – | –

jobtitle | Job Title | – | – | – | -

company | Company | – | – | – | -

stcaffiliation | STC Affiliation | – | – | – | -

bioid | Bio Article ID | – | – | – | -

photothumb | Photo | – | – | – | -

urltitle | URL-only Title | – | – | – | -

The tags structure in the form:

<txp:smd_bio_info items="name">
<a href="<txp:site_url /><txp:section name='leaders' />/<txp:smd_bio_info author='{smd_bio_info_item}' items='bioid' label='' />/<txp:smd_bio_info author='{smd_bio_info_item}' items='urltitle' label='' />" title="Bio link"><img class="author-thumb" src="/images/<txp:smd_bio_info author='{smd_bio_info_item}' items='photothumb' label='' />.jpg" /></a>    
<p class="author"><a href="<txp:site_url /><txp:section name='leaders' />/<txp:smd_bio_info author='{smd_bio_info_item}' items='bioid' label='' />/<txp:smd_bio_info author='{smd_bio_info_item}' items='urltitle' label='' />" title="Bio link"><txp:smd_bio_info author='{smd_bio_info_item}' items='RealName' label='' /></a></p>     
<p class="authorinfo"><txp:smd_bio_info author='{smd_bio_info_item}' items='teamrole' label='' />,<br />
      <txp:smd_bio_info author='{smd_bio_info_item}' items='stcaffiliation' label='' /></p>
</txp:smd_bio_info>

And here’s an example of the code in use for a user having a biography (thumbnail and name links), and one for a user having no biography (broken links).

I’ll have a look at your alternate suggestion too.

Last edited by Destry (2010-09-09 11:04:36)


The text persuades, the *notes prove。

Offline

#58 2010-09-09 15:53:04

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

Re: smd_bio : store additional biographical info about your users

Hello Stef,

I’m using your plugin to output the result of a bio item with the title: “What are you eating for breakfast ?” with 3 values: Bananas, Oranges, Kiwis

I would like to define other <txp:variables /> (plurals, first-capital…) based on the values returned by <txp:smd_bio_info />

So I’ve setup a form (myform) containing new empty variables:

<txp:variable name="flavor" value='<txp:smd_bio_info items="radioitems" label="">' />
<txp:if_variable name="flavor" value="bananas">
<txp:variable name="fs" value="Banana" />
<txp:variable name="fp" value="Bananas" />
</txp:if_variable>
<txp:if_variable name="flavor" value="oranges">
<txp:variable name="fs" value="Orange" />
<txp:variable name="fp" value="Oranges" />
</txp:if_variable>
<txp:if_variable name="flavor" value="kiwis">
<txp:variable name="fs" value="Kiwi" />
<txp:variable name="fp" value="Kiwis" />
</txp:if_variable>

When I try to output:

<txp:variable name="fs" />

It should, depending on what the user has selected as a breakfast item, output: Banana, Orange or Kiwi…

But through:

<txp:smd_bio_info items="radioitems" label="" form="myform"><txp:variable name="fs" /></txp:smd_bio_info>

It outputs nothing…

What am I missing here ?

Thanks !

Last edited by hablablow (2010-09-09 20:54:18)


_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__

Hablablow + Webdesignofficina

Offline

#59 2010-09-09 16:12:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,754
Website

Re: smd_bio : store additional biographical info about your users

hablablow wrote:

Is this a way to go ?

Without trying it out myself I’m not quite sure what you’re trying to achieve with the code. But my first question is: what is the closing smd_bio tag for? You have already self-closed it in the first line.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#60 2010-09-09 17:10:07

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

Re: smd_bio : store additional biographical info about your users

Sorry my explanation wasn’t clear and it contained typos… So I changed it above…
Hopefully it’ll make more sense this time…
Thanks for your comprehension…

Last edited by hablablow (2010-09-09 17:10:32)


_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__

Hablablow + Webdesignofficina

Offline

Board footer

Powered by FluxBB