Dakrtom Posted August 31, 2016 Share Posted August 31, 2016 (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 August 31, 2016 by Dakrtom line-Break Link to comment Share on other sites More sharing options...
Dakrtom Posted September 1, 2016 Author Share Posted September 1, 2016 No one knows a solution Link to comment Share on other sites More sharing options...
flydev Posted September 1, 2016 Share Posted September 1, 2016 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 ! 2 Link to comment Share on other sites More sharing options...
Dakrtom Posted September 1, 2016 Author Share Posted September 1, 2016 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 Link to comment Share on other sites More sharing options...
horst Posted September 1, 2016 Share Posted September 1, 2016 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? Link to comment Share on other sites More sharing options...
tpr Posted September 1, 2016 Share Posted September 1, 2016 Perhaps you should install a site profile and see how it's built, e.g the Blue VR or Zurb profile: http://modules.processwire.com/categories/site-profile/ Link to comment Share on other sites More sharing options...
deltavik Posted September 1, 2016 Share Posted September 1, 2016 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. Link to comment Share on other sites More sharing options...
adrian Posted September 1, 2016 Share Posted September 1, 2016 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 1 Link to comment Share on other sites More sharing options...
Dakrtom Posted September 2, 2016 Author Share Posted September 2, 2016 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 Link to comment Share on other sites More sharing options...
adrian Posted September 2, 2016 Share Posted September 2, 2016 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); } 1 Link to comment Share on other sites More sharing options...
Dakrtom Posted September 3, 2016 Author Share Posted September 3, 2016 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> Link to comment Share on other sites More sharing options...
adrian Posted September 3, 2016 Share Posted September 3, 2016 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now