Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-04-16 02:24:46

gregmasley
New Member
Registered: 2007-04-16
Posts: 6

problem showing pictures on all pages

I have a problem showing a picture on all pages of my website that I can’t figure out.

If I change this statement to show my pictures on all pages it doubles each article on each page.

I want to show my pictures on all pages without doubling the articles on each page but I can’t seem to do it.

</ul></div>

	<div id="main">



	<txp:if_section name="">
	<script language="Javascript">


var currentdate = 0
var core = 0

function StringArray (n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' '

  }
}

image = new StringArray(5)
image[0] = 'images/rotatingimages/photo1.jpg'
image[1] = 'images/rotatingimages/photo2.jpg'
image[2] = 'images/rotatingimages/photo3.jpg'
image[3] = 'images/rotatingimages/photo4.jpg'
image[4] = 'images/rotatingimages/photo5.jpg'

var ran = 60/image.length

function ranimage() {
  currentdate = new Date()
  core = currentdate.getSeconds()
  core = Math.floor(core/ran)
    return(image[core])
}

document.write("<img src='" +ranimage()+ "'>")

//-->
</script>

></div><txp:if_category>

<h2 class="categorytitle"><txp:category title="1" /> Category</h2>

</txp:if_category>

<txp:article limit="4" />

<txp:output_form form="postnavigation" />

</txp:if_section>

<txp:if_section name="about,contact,services,resume,quote">

<txp:article form="Single" listform="Single" />

</txp:if_section>

<txp:if_section name="links">

<txp:output_form form="links_page" />

</txp:if_section>

<txp:if_section name="archivescat">

<txp:output_form form="archivescat_page" />

</txp:if_section>

<txp:if_section name="archivesmonth">

<txp:output_form form="archivesmonth_page" />

</txp:if_section>

(Edited for better display of your code. -Els)

Last edited by els (2007-04-16 15:49:49)

Offline

#2 2007-04-17 00:32:45

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: problem showing pictures on all pages

It’s not your image JavaScript that is causing the problem. It is that you’ve got an article tag being called outside any condition, so it would always show. You then have the article tag being called again under certain conditions.

Offline

#3 2007-04-17 01:01:38

gregmasley
New Member
Registered: 2007-04-16
Posts: 6

Re: problem showing pictures on all pages

ok thanks how do I fix that in the code?

Offline

#4 2007-04-17 01:42:53

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: problem showing pictures on all pages

What section(s) is <txp:article limit="4" /> supposed to be used for?

Offline

#5 2007-04-17 02:43:27

gregmasley
New Member
Registered: 2007-04-16
Posts: 6

Re: problem showing pictures on all pages

not sure but here is the code:

<txp:output_form form=“DTD_head” />

</head>
<script src=“http://www.google-analytics.com/urchin.js” type=“text/javascript”>
</script>
<script type=“text/javascript”>
_uacct = “UA-692728-1”;
urchinTracker();
</script>
<body>

<div id=“wrap”>
<div id=“header”><h1>&nbsp;</h1> </div>

<div id=“nav”><ul> <li><a href=“http://www.masleyassociates.com/index.php”>HOME</a></li> <li><a href=“http://www.masleyassociates.com/about”>ABOUT</a></li> <li><a href=“http://www.masleyassociates.com/services”>SERVICES</a></li> <li><a href=“http://www.masleyassociates.com/resume”>HISTORY</a></li> <li><a href=“http://www.masleyassociates.com/contact”>CONTACT</a></li>

</ul></div>

<div id=“main”>

<txp:if_section name=”“> <script language=“Javascript”>

var currentdate = 0
var core = 0

function StringArray (n) { this.length = n; for (var i =1; i <= n; i++) { this[i] = ‘ ‘

} }

image = new StringArray(5)
image0 = ‘images/rotatingimages/photo1.jpg’
image1 = ‘images/rotatingimages/photo2.jpg’
image2 = ‘images/rotatingimages/photo3.jpg’
image3 = ‘images/rotatingimages/photo4.jpg’
image4 = ‘images/rotatingimages/photo5.jpg’

var ran = 60/image.length

function ranimage() { currentdate = new Date() core = currentdate.getSeconds() core = Math.floor(core/ran) return(image[core])
}

document.write(“<img src=’” ranimage() “’>”)

//—>
</script>

<DIV id=pageHeader>On-Site Computer and Network Repair, Sales and Service Colorado Springs</DIV>
<div id=“promotion”><b>We are Colorado’s premiere network of the top certified, computer and network experts available on-site at all times for you. Nobody else in Colorado has our level of combined qualifications and experience. We guarantee to beat any price, quality and service. If you want it done right the first time we are the people to see. Think of us as your outsourced IT department. Contact us today we are always available for hire.<p>719-649-7451 <a href=“mailto:info@masleyassociates.com”>info@masleyassociates.com</b></a></div><txp:if_category>

<h2 class=“categorytitle”><txp:category title=“1” /> Category</h2>

</txp:if_category>

<txp:article limit=“4” />

<txp:output_form form=“postnavigation” />

</txp:if_section>

<txp:if_section name=“about,contact,services,resume,quote”>

<txp:article form=“Single” listform=“Single” />

</txp:if_section>

<txp:if_section name=“links”>

<txp:output_form form=“links_page” />

</txp:if_section>

<txp:if_section name=“archivescat”>

<txp:output_form form=“archivescat_page” />

</txp:if_section>

<txp:if_section name=“archivesmonth”>

<txp:output_form form=“archivesmonth_page” />

</txp:if_section>

<div align=“center”><img src=“http://www.masleyassociates.com/images/certified.jpg” width=“495” height=“80”></div>
<div align=“center”><DIV ID=“counter”>This site has been viewed <span class=“count”><txp:ras_counter /></span> times</DIV></div>

</div>
<br><br><DIV id=sidebar>
<H2><a href=“http://www.masleyassociates.com/masley2.doc”><img src=“images/wordicon.jpg” width=“41” height=“41” border=“0” align=“bottom”></a><span class=“count”><a href=“http://www.masleyassociates.com/masley2.doc”><u>RESUME DOWNLOAD</u></a>
network engineer, network administrator, sys admin, IT director, IT manager, CIO, CTO, consultant, sysadmin, Microsoft, Cisco, Novell, MCSE, CNE, CNA, computer consultant, computer, network repair, sales, service, on-site, computer repair, PC, Colorado, network engineer, network administrator, sys admin, resume, maintenance, CO, repair, computers, A+, networks, email, virus, administration, installation, networking, certified, on site, Microsoft, support, IT, IS, MIS, consultant, computer guy, network support, network repair, computer consulting, PC repair, PC support, 719, maintenance, CO, network, server, uptime, upgrade, consultant, backup, virus, spy ware, computer network, network administration, sysadmin, printer, wireless, programming, IT recruitment, IT placement, website design, website promotion, search engine optimization, database design, e-commerce, network design, network audit, internet research, sourcing, disaster recovery, planning, computer maintenance and repair, computer maintenance, Exchange, e-mail, PC consultant, PC installation, PC sales, PC service, a+ computer repair, computer consultant, computer installation, computer maintenance and repair, computer maintenance repair, computer network repair, computer repair business, computer repair companies, computer repair company, computer repair Colorado, computer repair Colorado Springs, computer repair service, computer repair services, computer repair shop, computer repair shops, computer repair stores, computer repair technician, computer repair technicians, computer sale, computer sales, computer service, computer service and repair, computer store, computer support, mobile computer repair, network installation, on site computer repair, pc, pc computer repair, system administrator, Colorado, Colorado Springs, Pueblo, Denver, Aurora, Centennial, Highlands Ranch, Lakewood, Arvada, Glenwood, Boulder, Englewood, Colorado Springs, certified, computer, repair, sales, service, network, consultants, network engineers, network administrators, onsite</span></H2></txp:if_section>

</DIV>

<DIV id=footer>
<P><div id=“copyright”>&copy;Masleyassociates.com</div></P></DIV></body>
</html>

Offline

#6 2007-04-17 02:56:56

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: problem showing pictures on all pages

What do you mean, “you’re not sure”? We can’t help you if you don’t know what you want. ?

Offline

#7 2007-04-17 03:01:40

gregmasley
New Member
Registered: 2007-04-16
Posts: 6

Re: problem showing pictures on all pages

I understand, I am trying to put the rotating pictures on all my pages on my website, instead of just the home page http://www.masleyassociates.com, without having the articles repeat themselves. I do have a programming background but not in text pattern so I am out of my element here. My apologies.

Offline

#8 2007-04-17 03:07:07

gregmasley
New Member
Registered: 2007-04-16
Posts: 6

Re: problem showing pictures on all pages

When I remove the operative condition to show the rotating pictures on all my website pages instead of just only the homepage the articles repeat themselves and that is where I come to a standstill

Offline

#9 2007-04-17 03:19:04

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: problem showing pictures on all pages

Greg,

Your template is complex, includes a mix of HTML, javascript and Textpattern tags, and its behaviour depends on a bunch of things we can’t see (like your sections, article content, forms etc). There’s not much we can do to help unless you ask specific questions.

The FAQ describes the general steps you should take when trying to fix a template problem. In particular, see the section titled Isolate the problem code.

Last edited by zem (2007-04-17 03:19:45)


Alex

Offline

#10 2007-04-17 03:33:49

gregmasley
New Member
Registered: 2007-04-16
Posts: 6

Re: problem showing pictures on all pages

contact me off the list please gregmasley@adelphia.net I can show you

Offline

Board footer

Powered by FluxBB