Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2013-01-26 01:14:44

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,319

Re: New to TXP 4.54 - Making a Frontpage

I’d say it’s the <txp:if_search> tag pair. It’s not needed inside the search form, and can only be used on a results page.

wiki wrote:

The tag will execute the contained statements if the called page is the result of a search.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#17 2013-01-26 01:35:04

madzzoni
Member
From: Grünberg/Hessen/DE
Registered: 2013-01-22
Posts: 38

Re: New to TXP 4.54 - Making a Frontpage

… I removed the <txp:if_search> tag pair, but it doesn’t help ;-/

<form role="search" method="get" action="<txp:site_url />">
  <p><input id="search-textbox" type="search" name="q" value="<txp:search_term />"><input type="submit" value="<txp:text item='search' />"></p>
</form>

I used this code from the TXP Docs:
http://www.textpattern.net/wiki/index.php?title=Default_Forms#search_input

But thx.


<TXP:n00b />

Offline

#18 2013-01-26 09:28:10

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,566
Website GitHub Mastodon

Re: New to TXP 4.54 - Making a Frontpage

Can you post the complete page template that contains your search stuff and we’ll take a look.

Offline

#19 2013-01-27 02:52:52

madzzoni
Member
From: Grünberg/Hessen/DE
Registered: 2013-01-22
Posts: 38

Re: New to TXP 4.54 - Making a Frontpage

Thanks Phil. but i fixed the problem, and end up using the default form: “search_input” as is ;-)

I’ve added the Search-part-tags from the default-page to my new default “Homepage” like this:

<!-- is this result result page? also omits the pagination links below (uses pagination format within search_results.article.txp instead) -->
      <txp:if_search>
      <h1><txp:text item="search_results" /></h1>
        <txp:output_form form="search_results"/>
       <txp:else />
<!-- Homepage Intro -- >
        <txp:article limit="1" status="sticky" form="intro_homepage" />
  <!-- News-flash -->  
      <txp:article_custom section="article" class="newsflash" sort="posted desc" limit="3" form="static_headline" wraptag="ul" break="li" pgonly="0" />
     </txp:if_search>

I also learned already, that if you work with TXP in other language (like da_DK), DON’T change the original Sections-names, only the titles, if U don’t want a lot of work. ;-)

Best regards!


<TXP:n00b />

Offline

#20 2013-03-04 09:16:36

gour
Member
From: Hlapičina, Croatia
Registered: 2013-01-17
Posts: 124

Re: New to TXP 4.54 - Making a Frontpage

Dragondz wrote:

Like noted by phil above only add a code like that:

[…]

I tried the solutions presented here and pulling last 3 articles from the selected categories and display excerpts on the ‘homepage’ using ‘read more’ link.

Everything works except that when I click on the Category list on the right sidebar, it does not show any article?

Let me say that each article belongs to only one category, and I use /section/title schema.

I’ve also noticed that newer/older breadcrumb links do not work and just redisplay the same page, so I thought it must be some cleanURLS-related problem ‘cause I use Hiawatha webserver which runs behind Nginx reverse-proxy, but even after switching (temporarily) to Apache2, I had the same problem and now trying the same thing on my localhost (using direct Hiawatha server), I see that both category listing as well as breadcrumb links work on ‘default’ site with several dumb articles which means that I did some mistake in my tweaking of the site based on the above hints?

Any idea what do I miss to have category-listing and/or breadcrumb links not working?

Now I see that the problem is only that clicking on some category like e.g. novosti shows nothing?

I’d like to provide URL for my testing site, but atm, the host seems to have such DNS problems…

Here it is…

Last edited by gour (2013-03-04 10:08:34)

Offline

#21 2013-03-04 10:35:00

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,559
Website GitHub Twitter

Re: New to TXP 4.54 - Making a Frontpage

Hi gour

can you post the code of your page or the form that you use in the website? i suspect that there is a txp:if_undividual_article or txp:if_article_list issue!

Sorry i havent read the previous messages!!

maybe add status=“sticky” in the txp:article_custom would solve the problem.

Last edited by Dragondz (2013-03-04 10:38:19)

Offline

#22 2013-03-04 10:51:17

gour
Member
From: Hlapičina, Croatia
Registered: 2013-01-17
Posts: 124

Re: New to TXP 4.54 - Making a Frontpage

Dragondz wrote:

Sorry i havent read the previous messages!!

OK. Here is the diff between my ‘default’ and ‘‘homepage’ pages?

Do I miss something here?

maybe add status=“sticky” in the txp:article_custom would solve the problem.

I tried to add it in my ‘homepage page, but then I do not get anything ‘cause none of my articles are set to ‘sticky’ — I just want to pull the 3 newest ones to the homepage, but even setting those articles as sticky does not change anything.

Any further idea?

Offline

#23 2013-03-04 11:29:56

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,559
Website GitHub Twitter

Re: New to TXP 4.54 - Making a Frontpage

hi

can you show the enitire template, the code shown on the link begin with <txp:else />!

Offline

#24 2013-03-04 11:39:04

gour
Member
From: Hlapičina, Croatia
Registered: 2013-01-17
Posts: 124

Re: New to TXP 4.54 - Making a Frontpage

Dragondz wrote:

can you show the enitire template, the code shown on the link begin with <txp:else />!

Here it is:

Do I need to show something else?

Offline

#25 2013-03-04 12:12:09

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,559
Website GitHub Twitter

Re: New to TXP 4.54 - Making a Frontpage

Hi

can you remove txp:an7_filter and change txp:article_custom into code like that:

<txp:article sort="posted desc" limit="3">
<h3><txp:title /></h3>
<txp:excerpt />
</txp:article>

and see if that works?

Offline

#26 2013-03-04 13:45:47

gour
Member
From: Hlapičina, Croatia
Registered: 2013-01-17
Posts: 124

Re: New to TXP 4.54 - Making a Frontpage

Dragondz wrote:

and see if that works?

Putting that snippet into my ‘homepage’ page results in no article displayed. :-/

Offline

#27 2013-03-04 14:42:33

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,559
Website GitHub Twitter

Re: New to TXP 4.54 - Making a Frontpage

Article are set to use wich section?

Offline

#28 2013-03-04 20:38:23

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: New to TXP 4.54 - Making a Frontpage

Hi gour, are you aware of the tag trace? It will very likely give you some pointers. If you find it difficult to read, you can post it here and we can have a look.

Offline

#29 2013-03-04 22:16:16

gour
Member
From: Hlapičina, Croatia
Registered: 2013-01-17
Posts: 124

Re: New to TXP 4.54 - Making a Frontpage

Els wrote:

Hi gour, are you aware of the tag trace? It will very likely give you some pointers.

Not at all. This is something new for me. Thank you for mentioning it!!

If you find it difficult to read, you can post it here and we can have a look.

Probably I do atm…Here is the pastebin link which is generated for this URL which is empty although there should be several articles listed.

Any clue?

p.s. I’m using pastebin instead of cluttering forums with longer code-blocks, is it OK?

Offline

#30 2013-03-04 23:47:01

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: New to TXP 4.54 - Making a Frontpage

gour wrote:

Any clue?

It appears that the section your articles are in (blog) is not set to be displayed on the front page (see section settings). Though it might not seem apparent at first sight, category pages use the front page by default (URL like /category/category-name).
If the articles are displayed on their own section page (/section-name/?c=category-name), the articles will be displayed. See http://atmarama.sites.djangohosting.ch/blog/?c=novosti.
You can create links like that by using the section attribute in the category links.
Either that, or set section ‘blog’ to be displayed on the front page. Whichever you prefer.

p.s. I’m using pastebin instead of cluttering forums with longer code-blocks, is it OK?

Personally I prefer seeing the code in the forum posts. It saves me some clicking around, so I don’t see it as ‘cluttering’ the forum :) Also, I don’t think code on pastebin can live there forever. If someone reads this thread a year from now, it won’t be very helpful anymore without the code.

P.S. For your information, here is the part of the tag trace that shows it’s only looking for articles in sections that are set to be displayed on the front page:

                        [SQL (0.0011441707611084): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('novosti') or Category2 IN ('novosti')) and Section != 'blog' and Section != 'default' and Section != 'o-nama' and Section != 'arhiva' and Section != 'kontakt' order by Posted desc limit 0, 5]

Last edited by els (2013-03-04 23:54:55)

Offline

Board footer

Powered by FluxBB