2 of 3
2
Extension: MD Simple Relation. Creates a “simple” relationship field, storing only the entry_id.
Posted: 30 September 2008 08:07 AM   [ Ignore ]   [ # 19 ]  
Grad Student
Avatar
Rank
Total Posts:  88
Joined  05-21-2007

Excellent, that has done the trick, thanks Ryan

 Signature 

Twitter | African Budget Safaris | New Release


EE 1.6.7 | PHP 5

Profile
 
 
Posted: 30 September 2008 08:12 AM   [ Ignore ]   [ # 20 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

I updated the download at my site as well, which just adds the tweak outlined above. The package for the new version is called “ext.simple_relation_113a.zip”.

Glad that got is solved!

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 13 December 2008 08:40 AM   [ Ignore ]   [ # 21 ]  
Summer Student
Total Posts:  17
Joined  07-22-2008

Great extension. Nice and simple, just what I need. But I’ve got one problem…

I’m trying to make this work with Leandro’s jQuery lighbox, but for some reason, the extension always returns 2 extra images. For example, if I’m trying to display the 5 most recent images, the lightbox thinks there’s 7 images (even though there’s only 5 on the page), causing the “Next” button to appear on the 5th (and last image), leading to a dead end.

Here’s what I’ve got on the entry page:

{embed="films/gallerylinks" gallery_category="{gallery}"}

And the embedded template:

{exp:gallery:entries gallery="gallery" category="{embed:gallery_category}" orderby="date" limit="4" dynamic="off"}
      {entries}
      {row}
<a href="{image_url}" title="{category}"><img src="http://www.mysite.com/utilities/phpthumb/phpThumb.php?src=/images/gallery/{custom_field_one}/{filename}&w=115&h=80&q=95&zc=1" width="115" height="80" /></a>
      
{/row}
      {
/entries}
{
/exp:gallery:entries}

The lightbox is working perfectly on other parts of the site, so I assume there must be a conflict of sorts. Any help would be greatly appreciated.

Profile
 
 
Posted: 13 December 2008 02:45 PM   [ Ignore ]   [ # 22 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

What version of EE are you using? Can you just output the {gallery} variable to your page and look at the source code to see what it is actually outputting?

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 13 December 2008 06:59 PM   [ Ignore ]   [ # 23 ]  
Summer Student
Total Posts:  17
Joined  07-22-2008

No need, I’ve figured it out. Turns out I didn’t put the images in a unqiue div. Funny how you miss the simplest things when you’re sleep deprived. LOL

Thanks for the response though. smile

Profile
 
 
Posted: 15 December 2008 07:14 AM   [ Ignore ]   [ # 24 ]  
Summer Student
Total Posts:  17
Joined  07-22-2008

Hi again. I was wondering if it’s possible to have reverse relationships for galleries? That is, I would like a link on the related gallery category back to the original entry.

Profile
 
 
Posted: 05 January 2009 04:32 PM   [ Ignore ]   [ # 25 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  198
Joined  03-31-2002

Hi Ryan -

I’m just about to update my copy of ext.simple_relation.php to the latest version, and I see you’ve changed the name to ext.md_simple_relation.php.

Can you clarify what that might mean for upgrading? (I’ve used the previous version to set up a lot of relationships, and I don’t want to bork them smile )

As the extension now has a different name, I’m assuming I’ll have to de-install the first version and reinstall the second, which I fear may lose all my existing relationships. Or should I just rename the second file ext.simple_relation.php?

Looking forward to any advice, thanks.

 Signature 

Les McKeown

Profile
 
 
Posted: 08 January 2009 09:03 PM   [ Ignore ]   [ # 26 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

Les, I would strongly suggest updating, for sure, as that old 1.0.2 version has a lot of old-school check for update stuff in it that will very often cause problems on the CP homepage.

Sorry about the name change, but I should have prefixed it with the ‘MD’ in the first place.

This is what I would do.

1) Make a quick backup of your DB.
1a) Note all the custom fields you have that are currently Simple Relation Fields.

2) Disable/uninstall Simple Relation.

3) Install/enable MD Simple Relation.

4) Go through your custom field groups setting the custom fields that were SR (and may now be showing as blank) to MD SR.

You should be good at this point. May take you a couple minutes, but should be relatively painless. Uninstalling the first version of the extension shouldn’t do anything to the data in the field - and those fields are only storing a simple number (which was all I wanted).

If you need any help, ping me.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 08 January 2009 09:06 PM   [ Ignore ]   [ # 27 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006
tehlupin - 15 December 2008 07:14 AM

Hi again. I was wondering if it’s possible to have reverse relationships for galleries? That is, I would like a link on the related gallery category back to the original entry.

Sorry, I was unsubscribed to this thread. You could do this with the query module. Get the gallery id, then use the query module to…ACTUALLY you could probably use a simple embedded template that has a weblog entries tag in it - and then just pass the gallery ID to the search parameter of the embedded weblog:entries tag through an embed variable.

I’ll bet that would work like magic. Did that make sense?

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 11 January 2009 03:58 AM   [ Ignore ]   [ # 28 ]  
Summer Student
Total Posts:  17
Joined  07-22-2008

Thanks for the reply. I couldn’t get the embedded template method to work, presumably because the weblog search parameter only works with standard custom fields, but I’ve taken a stab at running a query.

{exp:query sql="SELECT entry_id FROM exp_weblog_data WHERE field_id_13 = 5"}
<span class="small"><a href="/films/{entry_id}/">&laquo; Return to title</a></span>
{/exp:query}

The only problem is that I’m not quite sure how to grab the particular category id.

Profile
 
 
Posted: 14 January 2009 10:35 AM   [ Ignore ]   [ # 29 ]  
Summer Student
Total Posts:  23
Joined  05-21-2006

Think you could post a copy of 1.0.2 for download?  I accidentally borked the upgrade and it looks like I’ll need the old version to get back into my EE Control Panel.

Profile
 
 
Posted: 23 January 2009 07:05 PM   [ Ignore ]   [ # 30 ]  
Grad Student
Rank
Total Posts:  85
Joined  01-24-2006

Ryan, this is an awesome extension - exactly what I need, with one minor exception! I can’t get it to work in a SAEF.
Do you, or perhaps someone else, know if this is possible or how I’d go about hacking things to make MD Simple Relation work in a SAEF?

 Signature 

Vibe9 Design - Vancouver Web Design Company

Profile
 
 
Posted: 23 January 2009 07:17 PM   [ Ignore ]   [ # 31 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

Doh! Maybe I can have a look-see at it this weekend. Question: are you using this in the default SAEF, between the {custom_field} tag pairs, or are you hard coding your custom fields?

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 23 January 2009 07:53 PM   [ Ignore ]   [ # 32 ]  
Grad Student
Rank
Total Posts:  85
Joined  01-24-2006

Yes, using the default between the {custom_field} tags - the label shows up, but no input field at all. 
I have not tried hard coding it, you think that could work?

 Signature 

Vibe9 Design - Vancouver Web Design Company

Profile
 
 
Posted: 23 January 2009 09:18 PM   [ Ignore ]   [ # 33 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

I think that’s all or nothing - you can’t just do one custom field manually. You do them all, or you let the {custom_field} tags do their thing.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 24 January 2009 12:11 AM   [ Ignore ]   [ # 34 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

Wow, I just tried monkeying with this on a SAEF and got nowhere. SAEFs are tough, with custom field types. The problem with Simple Relation is that the field type is “simplerel”, so the SAEF doesn’t know what to do with it.

The closest I did get was trying to hack /system/modules/mod.weblog_standalone.php. I was attmpting to replicate the ‘rel’ field type. That was not pretty.

The next thing to try - and this may not work for you - it to manually do the custom fields. That may not be cool, because that might require a bunch of PHP on the template, with a custom query, to get the contents of the pulldown, etc etc.

To be honest, I don’t worry about SAEFs much because I don’t use them, myself.

I did just put this extension in a public repo on GitHub tonight: MD Simple Relation at GitHub. So, if anyone wants to take a stab at maybe using another extension hook to get this thing to work in a SAEF, then go ahead and fork it, and best of luck to you in doing so. If you get it to work, send me a Pull Request and we’ll fix this thing up right.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 24 January 2009 11:16 AM   [ Ignore ]   [ # 35 ]  
Grad Student
Rank
Total Posts:  85
Joined  01-24-2006

Thanks for giving it some effort Ryan. I generally don’t use SAEFs either, but in this case I need it because what I’m doing is creating a business directory where companies can login publicly and request inclusion.  The businesses are stored in a weblog, and then related to a location (another weblog) as well as categorized by service/product type, hence the need for your extension.

I would not know enough PHP to pull off anything custom, but do you think this might work: manually coding the custom_fields in the SAEF and doing a call to the weblog entries for ‘location’ with the value for each option being entry_id?

 Signature 

Vibe9 Design - Vancouver Web Design Company

Profile
 
 
Posted: 24 January 2009 01:01 PM   [ Ignore ]   [ # 36 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

On the very rare occasions that I’ve used a SAEF, I’ve always manually done the fields. It’s a little more work, but much more flexible that way.

You could do all your fields manually, and for the Simple Relation field do a custom query, just as you suggested. This may be the way to go. You could lift the query right out of the extension, and hardcode the values in there for the field you’re on (to replicate what your settings for the custom field in the CP).

That shouldn’t be too terrible to do.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
   
2 of 3
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120410 Total Logged-in Users: 63
Total Topics: 126512 Total Anonymous Users: 29
Total Replies: 665259 Total Guests: 277
Total Posts: 791771    
Members ( View Memberlist )