Jump to content

Directing landing article page to a specific post?


PhotoWebMax
 Share

Recommended Posts

I have the site up on the Lightning system.

It pretty much mirrors the issues involved with this thread. An additional issue on the Lightning site is that the gallery system thumbnails do not show? I think the paths are broken somehow? The full size images work just fine and the jQuery script I am using does its thing...

Anyway, If any of you are gracious enough to take a look I can provide you with the URL and FTP for the Lightning site. (not sure how this sharing of login works). For now I would prefer not to provide this info publicly...

Thanks!

Max

Link to comment
Share on other sites

Yes, two minutes ago!

Adrian went into the Lightning site and all it was that my post page foreach statement was in the articles template. It should have been in the template that functions for the hidden posts container page that stores the actual articles. Now that I look at this it becomes so obvious. But I spent so much time on this without thinking of this. Hopefully a lesson learned. I hope this thread might serve some other new kid someday...

One other thing: I have a working gallery system on this Lightning site. The thumbnails do not show but they do on my localist install that uses the same everything. What do I look for to fix this? Or should I ignore it and track it down when I upload the real live version of this site in the next few days. This will be my first live PW site...

Again, thanks to all who contributed so much here...  :cool:

  • Like 2
Link to comment
Share on other sites

I am still messing with this...

I now have my posts.php template controlling the appearance of my articles (that are housed in a hidden page called posts). The html fragment identifier works perfectly.

One issue: before I got the html fragment identifier working I did have a <ul class="articlePost">  selector added to each post within my template for added CSS styling of each article.

This is the code I have now for the foreach statement with the fragment identifier system (note the W3C validator suggested I change name to "a name" to "a id" inside the echo):

...

<h2>Articles & More...</h2>
<div id="articlesContainer">
<?php
foreach($page->children as $article){ 
	
    echo "<a id=".$article->name."><h2>".$article->title."</h2>
        ".$article->article_maintext."";

}

?>
</div><!--articlesContainer ends-->

...

This works. But I want to add the <ul class="articlePost"> wrap to each article foreach. I have tried several attempts at doing this but I seem to keep getting parse errors? 

The closest (still thawing a parse error) I have come up with no color indicating errors inside Textmate looks like this:

<h2>Articles & More...</h2>
<div id="articlesContainer">
<?php
foreach($page->children as $article){ ?>
	   <ul class="articlePost">
    echo "<a id=".$article->name."><h2>".$article->title."</h2>
        ".$article->article_maintext."";
	echo "</ul><!--articlePost ends-->";
}

?>
</div><!--articlesContainer ends-->

Can someone check my code above and show me how to add the <ul class="articlePost"> for me? It must be getting inside and escaping the PHP tags correctly...

Thanks! 

Link to comment
Share on other sites

Never mind, I think I got it...

<h2>Articles & More...</h2>
<div id="articlesContainer">
<?php
foreach($page->children as $article){ ?>
	   <ul class="articlePost">
   <?php echo "<a id=".$article->name."><h2>".$article->title."</h2>
        ".$article->article_maintext.""; ?>
<?php	echo "</ul><!--articlePost ends-->"  ?>
	<?php 
}

?>
</div><!--articlesContainer ends-->
Link to comment
Share on other sites

Adrian, you are probably correct on the semantic aspect. I will try adding the <ul> back. This will mean adding the <li>s as well, but that will be a good exercise for me. I really need to practice how to write these php code blocks in my templates. I am slowly getting it though...

I have done a bunch since you checked out the site. I am back working locally again. Hope to take this live in the next couple of days ( I have a ton of photography (shooting eyeglasses) to do this weekend)...

  • Like 1
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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