Jump to content

Output of page field is "InputfieldText" when it shouldn't


Pip
 Share

Recommended Posts

Hi all. 

Playing around with Processwire and wrapping my brain around the basic stuff. So far so good, until I hit on a field in my page where the output is "InputfieldText" which ought not to be.

Let me explain my workspace:

The Template
I have a template with the following structure: 

  • Title
  • Confabulation_Body (Text area)
  • Confabulation_Pseudonym (Text)

Output Pages
I have two output pages: (1) All pages I created and (2) everyone's pages. 

All pages I created looks like this: (which is btw the correct output) 
image.thumb.png.cd4e58dad903d94e618f3108580052e0.png

			$newcolors = array() ; 
			$confabulations = $pages->find("template=confabulation, limit=5; created_users_id=$currUser"); 
			foreach ($confabulations as $i) {
				$newid = intval($i->id) - $basepageid;
				$newcolors = genColor();
			
				echo "<div class=\"post ". $newcolors[2]. "\" style=\"background-color:#". $newcolors[0] .";\">"
			 			. "<a href=\"". $i->url ."\"><div class=\"flap\" style=\"background-color: #". $newcolors[1] ."; color: #". $newcolors[0] ."\">"
						. $newid ."</div></a>"
						."<h2>".$i->title."</h2>".$i->confabulation_body."<div class=\"author\">".$i->confabulation_pseudonym ."</div>
						<div style=\"clear:both;\"></div></div>"; 
			}

While the page to show Everyone's pages : 
Note the InputFieldText

		<?php 
			// Echo all posts 
			$newcolors = array() ; 
			$confabulations = $pages->find(" id>1018, template=confabulation, sort=-id, limit=5"); 
			foreach ($confabulations as $i) {
				$newid = intval($i->id) - $basepageid;
				$newcolors = genColor();
				// $newcolors [0] = background 
				// $newcolors [1] = flap 
				// $newcolors [2] = text

				echo "<div class=\"post ". $newcolors[2]. "\" style=\"background-color:#". $newcolors[0] .";\">"
			 			. "<a href=\"". $i->url ."\"><div class=\"flap\" style=\"background-color: #". $newcolors[1] ."; color: #". $newcolors[0] ."\">"
						. $newid ."</div></a>"
						."<h2>".$i->title."</h2>".$i->confabulation_body ."<div class=\"author\">".$i->confabulation_pseudonym ."</div>
						<div style=\"clear:both;\"></div></div>"; 
			}
			
			
		?>

The Environment
My environment (in case though theoretically it should work fine still): 

  • Latest version of XAMPP
  • Editor Tool: Dreamweaver

Has anyone experienced such a bizarre behavior? Did I do something wrong? Is my laptop cursed? 

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...