Jump to content

Recommended Posts

Posted (edited)
Hello,
I hope someone can help me. After I work with ProcessWire only recently , I wanted to ask if we can someone tell me as 
I a headline on one side with the corresponding article on another page link directly ??

Greeting
Tom
Edited by Dakrtom
line-Break
Posted
1 minute ago, Dakrtom said:

No one knows a solution

Welcome Dakrtom !

 

We would be glad to help you, but I am sorry that (I personnaly) cant understand your posts ! O0

  • Like 2
Posted
 
Hello, thank you for your answer. I try my question to rephrase . 
I would like to create a home ProcessWire be shown on the various articles or posts . 
When I click on the title of the article I müchte I am redirected to the orignal article . 
I hope my question is understandable

Greeting
Tom
Posted

As far as I understand, you want something like a teaser homepage? A collection (in boxes) of subpage summaries with a read-more-link?

If yes, how do you have organized your (sub)pages? Where do they live in the page tree? Do they have different templates? What are the most important fields they have?

Posted

Seems like you want 

10 hours ago, Dakrtom said:
I would like to create a home ProcessWire be shown on the various articles or posts . When I click on the title of the article I müchte I am redirected to the orignal article . I hope my question is understandable Greeting Tom
 

Can you give an example of any website that does what you want? That may help us in answering your question. 

Posted

My guess is that you mean a list of articles with perhaps a summary and then each one links to the full article. You would construct your site to have a child page for each article. Then you can do

foreach($page->children("limit=10, sort=-published_date") as $article) {
	echo "<a href='$article->url'>$article->title<\a>$article->summary";
}

That will display titles and summaries of the last 10 articles with direct links to the page where the full article lives.

Apologies for the brevity and code formatting - not a good idea to try this on a phone while your laptop is running updates :)

 

  • Like 1
Posted
Hello, thank you for your answers. not exactly what I was looking for. So it is on the home page a 
teaser its various teaser texts be my link refers to the articles . can me someone with the links and the teaser help
Posted

The code I gave you does pretty much that assuming you have a separate field for the teaser (I called it summary). If you want an automatic teaser than you need to truncate the body field (or whatever you might have called it). Instead of $article->summary, you can try something like:

substr($article->body, 0, 300)

Of course you can get much fancier with automatic teasers, but that is a PHP question and there are lots of answers on the web about that.

Also, if you want the code I had to work from the homepage while the articles are perhaps under an Articles child of home, then try this:

foreach($pages->get("/articles/")->children("limit=10, sort=-published_date") as $article) {
	echo "<a href='$article->url'>$article->title<\a>".substr($article->body, 0, 300);
}
  • Like 1
Posted
Hello,
many thanks for the code , yesterday equal yet tried it and works great but a 
question I have to . how I do it that I and summary with html and css can edit Title : here an example :

<P > title </ p>
<P > summary </ p>
Posted
3 hours ago, Dakrtom said:

Hello,
many thanks for the code , yesterday equal yet tried it and works great but a 
question I have to . how I do it that I and summary with html and css can edit Title : here an example :

<P > title </ p>
<P > summary </ p>

I am sorry @Dakrtom - now you have completely lost me :)

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...