We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Custom Fields in {exp:weblog:entries /}

Development and Programming

Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

great glad it worked!

       
Ozmodiar's avatar
Ozmodiar
16 posts
18 years ago
Ozmodiar's avatar Ozmodiar
{exp:weblog:entries weblog="events" Textd="/^$/"}

What is the proper syntax for “if Textd is empty” ? In a previous thread, you suggested the code above, but it doesn’t work. (No entries are shown).

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

since the extension now just runs a SQL query you can just do this:

{exp:weblog:entries weblog="events" Textd=""}
       
Ozmodiar's avatar
Ozmodiar
16 posts
18 years ago
Ozmodiar's avatar Ozmodiar

It doesn’t seem to work. I get no results.

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

try this:

{exp:weblog:entries weblog="events" Textd="="}

Technical response: the “=” means perform an exact match, without the “=” in quotes the generated sql would be LIKE “%%” which would match everything. Placing the “=” there makes the sql =”” which is what you’re looking for.

       
David Webb's avatar
David Webb
62 posts
18 years ago
David Webb's avatar David Webb

OK.

It looks like I’ve got to the same point as some other people and I’m trying to get this to work with segments. No dice.

A the moment I’ve got

{exp:weblog:entries weblog="v2_gigs" orderby="v2_gigs_venue|date" sort="desc|asc" v2_gigs_band1="{segment_3}"}

{entry_date format="%j%S of %M"} at {related_entries id="v2_gigs_venue"}{title}{/related_entries} {if v2_gigs_tour != ""}on the {v2_gigs_tour}{/if}


{/exp:weblog:entries}

Which gives me nothing when there is a valid segment 3.

Now ideally I need to check segment 3 against all of the below custom fields.

v2_gigs_band1
v2_gigs_band2
v2_gigs_band3
v2_gigs_band4
v2_gigs_band5

I’m basically trying to show a list of gigs that a band has played. Now the band can appear in any of the custom_fields because they may not always be on the same level of the bill. In a small venue they may headline (v2_gigs_band1) and in a large venue they may be an opener (v2_gigs_band5) or anywhere in between.

Thanks in advance for the help

DJ

—//—

HOLD FIRE on this one I’m trying to do it with reverse related entries and it might just be working 😊

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

I’m looking forward to wether you get it working with reverse_related_entries as that would probably be the faster way to go anyways.

       
David Webb's avatar
David Webb
62 posts
18 years ago
David Webb's avatar David Webb

Hey Mark.

Yeah got it working. :lol: I like trying to do things the hard way 😊

A lot simpler to do it with a reverse related entries and a single query.

It’d still be good to get confirmation that we can set a custom field with a segment.

Thanks as always for all your hard work.

       
Linda A's avatar
Linda A
647 posts
18 years ago
Linda A's avatar Linda A

I never did manage to get it working with the extension and a mySQL regexp to fetch a certain set of entries (it would be great if there was an option to match only from the start of the contents of a field), but now I’ve got another little task that I am hoping that it might be able to help me with. 😊

I am trying to do a sort of webring through EE, and one feature I need is next site & previous site. The way I had thought of doing this is having a ‘Next’ and a ‘Previous’ template that is setup to serve up a specific site depending on what is in the third segment. The third segment will hold the contents of the custom field called ‘ID’. So, if the third segment reads ‘4’ and you’re visiting the ‘Next’ template, the template should display the site where the ID is ‘5’. And if it was the ‘Previous’ template, it should display the site with ID ‘3’.

Is it possible to use the extension in such a way that you tell it to look in the custom field ‘ID’ for segment_3 + 1 or segment_3 - 1?

       
tpayton's avatar
tpayton
172 posts
18 years ago
tpayton's avatar tpayton

Mark,

I was scratching my head (and a little banging) tyring to get this working for weeks, but then found this forum and the mods that needed to be made to mods.weblog.php. Saved the day as our client presentation is tomorrow.

So is it possible to perhaps put the instructions or at least the need for the mods inside the extension so when it is viewed in the Extension Manager it shows up under “Documentation” or “Settings?”

Thanks for all the great work.

  • T.
       
Linda A's avatar
Linda A
647 posts
18 years ago
Linda A's avatar Linda A

Figured out how to use the extension to get me custom field value +/- 1: the greater than/lesser than option and a limit of 1. So easy. This really is a great extension. 😊

Would it be possible, btw, to have an option to match the pattern against the start of the custom field value only? I think that’d solve my issue with selecting a range that starts with, for example, 2.1., and not getting 2.2.1. as well.

       
Linda A's avatar
Linda A
647 posts
18 years ago
Linda A's avatar Linda A

Hmm, okay, maybe I spoke a bit too soon:

{exp:weblog:entries weblog="{current_weblog}" 9_id="<{segment_3}" limit="1" disable="pagination" dynamic="off"}

The above code works as it should. When the segment is ‘5’, it gets me the entry with ‘4’ in the ‘9_id’ field.

However, the code below here does not work. Regardless of what the segment shows, I get the entry with ‘7’ in the ‘9_id’ field:

{exp:weblog:entries weblog="{current_weblog}" 9_id=">{segment_3}" limit="1" disable="pagination" dynamic="off"}
       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

You may want to try using the orderby= attribute and the sort= attribute depending on if you’re using greater than or less than. can you give some examples of what you’ve tried as a segment to get ‘7’

       
Linda A's avatar
Linda A
647 posts
18 years ago
Linda A's avatar Linda A

I believe I tried ‘1’, ‘2’ and ‘5’.

How would you suggest that orderby= and sort= be set for the greater than and lesser than setups? What I find odd is that using lesser than seems to work just fine. I tested that with several different values as the segment, and it worked each time.

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

We’ll my thinking is that if you say you want numbers less than 5 you’ll get 1,2,3 and 4. However you only want 4 (I think), so to to get that you’d want the sort to be DESC (which I think is the default).

If you want numbers greater than 5 you’ll get 6,7,8,9 and 10 (assuming 10 is your largest entry). Limiting this by one gives you 10 (if they’re in DESC order). Make it ASC order when your choosing a greater than and you’ll get the entry directly following ‘5’.

That was my thinking…

       
First 3 4 5 6 7 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.