We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43280
    • 15 Posts
    Okay I have a blog style web page, and I am having some issues with an image tv i created for an image with each blog post.

    I have successfully gotten the front page to output the tv image from each blog post using get resources and the rowTpl. The front page is working perfectly.

    the problem i get is with my "blogArticle" template --that is, when someone clicks to go to the dedicated article page, I CANNOT get that same image tv to show up. I have a template called "blogArticle.html" that is the template for specific article pages (not the container.) and I have some code like this:

    <!--header ( blog post image) -->
    				<div class="">
    					[[*blogEntryImg]]
    				</div>
    				<!--main blog article conainter post div and sidebar **note** mod X "article" calls needed in these sections -->
    			    <div class="row">
    			    	<div class="col-md-8 col-lg-7 articleMain"> <!--article div -->
    			    		<div class="articleTitle"> <!--Date/Title of blog post here (modX calls) -->
    							[[*publishedon:strtotime:date=`%b %d, %Y`]]
    			    			[[*pagetitle]] 
    			    		</div>
    						<div class="articleBody">
    							[[*content]]
    						</div>
    			    	</div>
    					<div class="col-md-4 col-lg-5 articleSideBar"> <!--sidebar -->
    						<div class="articleInfo">
    							Posted By : [[*publishedby:userinfo=`username`]]
    						</div>
    						<div class="articleTags">
    							Tags: [[+article_tags]]
    						</div>
    					</div>
    			     </div>			



    ...And when i use this the image does not show. when i inspect the page in firefox, it seems to render the html properly but for some reason the link for the image source links to my front page html? Im not sure what I'm doing wrong here.

    A few other tidbits of info:

    i have uploaded the files manually via ftp as the modX upload interface wouldnt let me upload the images (they are kinda big @ 2mb)

    i made my own "media" folder to put these images in.


    is there another way i need to access that image tv? i have given that specific template access to the tv, so i figured [[*nameOfTV]] would work in this situation. if not can someone help me figure out the right way to do this?

    [ed. note: wonderfulweb last edited this post 10 years, 5 months ago.]
      • 43280
      • 15 Posts
      okay i've found a way to solve my problem.

      for anyone interested here is what i found out and how i "fixed" the issue.

      on my "blogArticle" template I was trying to use the [[*nameOfTv]] call to post the image tv associated with the blog post as a piece of the header. this was not working properly although by using the inspector in the browser i noticed that the image source was being rendered as src="media/image.png" and this was causing an issue...if i were to add a slash using the inspector so it looked like src="/media/image.png" it started to work as intended.

      digging into the manual i found that i can make this work properly by adding a media source for the specific folder i made to put the images in. (http://rtfm.modx.com/revolution/2.x/administering-your-site/media-sources/adding-a-media-source) once i made a specific folder media source, versus just using the default "filesystem" one, the tv rendered the images correctly with the [[*nameOfTv]] call.

        • 44561
        • 2 Posts
        Could you expand on what you did exactly to create the media source to make the image show up? I'm having this same issue. Before creating the media source, the src attribute of the image was blank. Not until after I created the media source like you did it generate src="/media/"
          • 43280
          • 15 Posts
          Quote from: zackography at Sep 10, 2014, 03:37 AM
          Could you expand on what you did exactly to create the media source to make the image show up? I'm having this same issue. Before creating the media source, the src attribute of the image was blank. Not until after I created the media source like you did it generate src="/media/"

          Hello, to be honest I am not quite sure why this worked; It may have something to do with hierarchy of folders within the modx install (my new media folder now sits at the top level, not nested within assests etc). But I haven't gotten deep enough within modx to understand why this works the way it did. Sorry I couldn't be of more help!
          • Do you have the base meta tag in your template's HTML head?
            <base href="[[++site_url]]">

              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 44561
              • 2 Posts
              Yes I do. This is the code I have for the base meta tag.
              <base href="[[++site_url]]" />