Articles Anywhere

duplicate category title

1 month 5 days ago #77482

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

I am loving the versatility of AA, but I am still learning....

I can't figure out what I am doing wrong. The category title "Virtual EMS Educator Bios" is showing twice.

This is my code:

{articles category="72"}
		<h3>[category_title]</h3>
		{/articles} {articles category="72"} {slider [title]} [text] {if last}{/sliders}{/if} {/articles}</div>

This is the page: 173.236.80.186/~medicce/index.php?option...le&id=134&Itemid=429

1 month 5 days ago #77484

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

oh wait I get it. I can just use one line instead of separating it out!

{articles category="72"}
		<h3>[category_title]</h3>
		{slider [title]} [text] {if last}{/sliders}{/if} {/articles}</div>

1 month 5 days ago #77485

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

oh boy... this doesn't work either because it displays the cat title within each slider....

Please help :-)

1 month 5 days ago #77486

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

The category ID is 72. And the articles from the cat display correctly. But if I go back to this code:

{article category="72"}
		<h3>[category_title]</h3>
		{/article}

It for some reason show "About Us" which is catid 12. Weird. :unsure:

1 month 4 days ago #77489

Peter van Westen's Avatar Peter van Westen Admin

If you only want to show the category title once either add a limit="1" to the {articles} tag, or surround the [category_title] tag with an {if first}...{/if} tag.

1 month 4 days ago #77492

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

Here is my final code that looks great, thanks!!

{articles ordering="title" category="72"} {article category="72"}
		<h3>{if first}[category_title]{/if}</h3>
		{/article}{slider title="[title]" class="icon"}
		<div class="bio">[image-intro]</div>
		[text]{/sliders}{/articles}</div>

1 month 4 days ago #77494

Peter van Westen's Avatar Peter van Westen Admin

You should not be nesting {article} tags inside {articles} tags.
This should work:

{articles ordering="title" category="72"}
	{if first}<h3>[category_title]</h3>{/if}

	{slider title="[title]" class="icon"}
		<div class="bio">[image-intro]</div>
		[text]
	{/sliders}
{/articles}

1 month 4 days ago #77495

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

The odd thing is that this one displays catid=12:

{articles ordering="title" category="72"}
	{if first}<h3>[category_title]</h3>{/if}

I used your second recommendation but I had to move the </div> otherwise the responsive grid messed up the layout:

Here is the whole article code:
<hr id="system-readmore" />
<div class="zen-row">
	<div class="zg-col zg-col-7">
		<p>Medic-CE has the very best EMS educators on our team teaching your virtual, instructor-led classes. Our education staff is comprised of experienced EMS educators, chiefs, and clinical experts in both pre-hospital and critical care transport medicine who take an active, hands-on approach in the delivery of our virtual, instructor-led programs.</p>
		{articles ordering="title" category="72"} {if first}
		<h3>[category_title]</h3>
		{/if} {slider title="[title]" class="icon"}
		<div class="bio">[image-intro] [text] {/sliders} {/articles}</div>
		<div class="zg-col zg-col-5">
			<div class="zen-center bluebox">
				<h4>Complete this form. On the dropdown choose "Contact an Educator".</h4>
			</div>
			{rsform 3}</div>
	</div>
</div>

1 month 4 days ago #77496

Peter van Westen's Avatar Peter van Westen Admin

Weird. If you want me to look into the wrong category issue, please give me (super) admin and (s)ftp access so I can take a look.
And tell me on what url I can see/reproduce the issue.
You can use the 'Hidden text' button in the forum editor to hide the confidential information.

1 month 4 days ago #77497

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

The code is working now, but you are welcome to login in. Maybe this will help you to figure out if its a bug or user error. ;)

Confidential information:
(hidden)

1 month 4 days ago #77500

Peter van Westen's Avatar Peter van Westen Admin

All seems to work fine as far as I can see.

Can you create an example of where it outputs a different category name than it should?

1 month 4 days ago #77509

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

173.236.80.186/~medicce/index.php?option...le&id=298&Itemid=429

It displays the title from catid 12 instead of 72.

1 month 4 days ago #77510

Peter van Westen's Avatar Peter van Westen Admin

Not sure why. But that is not really how you are supposed to use the single {article} tag. You should give it an article (title/alias/id) to display.
Use the {articles} tag to use filters. If you want to return one article based on the filters, use the limit="1" in there.

1 month 1 day ago #77579

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

Sorry but I am still learning the ins and outs of AA.

So I wanted to display a different category title within an article.

In article "Alabama" that is in cat 37, I used this code:

<h3 class="zen-center">{article category="79"}[category_title]{/article}</h3>

But the category title from 37 gets displayed which is "States".
173.236.80.186/~medicce/index.php?option...cle&id=135%3Aalabama

So I figured out the issue that my code category="79" is ignored. What am I doing wrong?

1 month 21 hours ago #77589

Peter van Westen's Avatar Peter van Westen Admin

So are you still nesting {article} tags within the same article?

1 month 21 hours ago #77591

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

AFAIK, this does not have anything to do with nesting.

I created a new TEST article here that is only using the following code; no nesting:
173.236.80.186/~medicce/index.php?option...&view=article&id=304

<p>I want this to show the title of catid 79 which is "Fire-CE"</p>
<p>WRONG CATEGORY TITLE &gt; <strong>{article category="79"}[category_title]{/article}</strong></p>
<p>But its showing the cat-title of the cat that this test article is in.</p>

https://www.dropbox.com/s/kqev1d3rkqwse5s/Screen%20Shot%202018-01-24%20at%201.00.04%20AM.png?dl=0

1 month 20 hours ago #77592

Peter van Westen's Avatar Peter van Westen Admin

Like mentioned before: you shouldn't be using the single {article} tag for applying category filters. The single {article} tag is to output a single article by its title, alias or id.
Use the {articles} tag to use filters. If you want to return one article/value based on the filters, use the limit="1" in there.
So:

{articles category="79" limit="1"}[category_title]{/articles}

1 month 20 hours ago #77593

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

There is something wrong then because when I try that code it doesn't display anything. :unsure:

https://www.dropbox.com/s/wdye0w7fl0nho2p/Screen%20Shot%202018-01-24%20at%201.16.46%20AM.png?dl=0

173.236.80.186/~medicce/index.php?option...&view=article&id=304

1 month 20 hours ago #77594

Peter van Westen's Avatar Peter van Westen Admin

You do not have any articles directly under category 79. So Articles Anywhere cannot return any data.
Your filter returns no results.

1 month 20 hours ago #77595

Odin (PKA Jeff) Mayland's Avatar Odin (PKA Jeff) Mayland

Ah, so if there are no articles then it won't display the [category-title]. I didn't realize it was required.

Do you have another method/plugin to display the category title in this way?
I'm going to have 1000s of places for this category title and I want to be able to only have to edit them in the category manager.