# Strange Publishing Issue with Resources

**URL:** <https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640>\
**Category:** RapidWeaver Classic\
**Created:** [October 3, 2018, 11:52am UTC](https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640 "2018-10-03T11:52:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sykomac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/sykomac/32/11664_2.png) [@sykomac](https://forums.realmacsoftware.com/u/sykomac)\
**Post date:** [October 3, 2018, 11:52am UTC](https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640/1 "2018-10-03T11:52:31Z")

</div>

Good day.

Just started having this issue. When using resources, sometimes it puts in the correct path, sometimes it doesn’t.

Mac OS X 10.11.6 RW 8.0.3

In my file I have a couple links with URL like “%resource(css/order.css)%”. When publishing, sometimes it put in the correct URL, sometimes it leaves the code just the way it is.

Doesn’t matter if I use it in the Code–\>Head section or if I put it in the Page–\>HTML Code–\>Head for an individual page.

For example - in the code below, the first two links should have “…/…/” in front like the third line. The fourth line it just messed it all up - it left the reference to the resource but left off the ending “)” (the ending “)” is in the code in my RW file.

`
	
	
	
    
	
`

I can send the ZIP’d RW file if anyone wants to look. Along with the output I am getting.

Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![sykomac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/sykomac/32/11664_2.png) [@sykomac](https://forums.realmacsoftware.com/u/sykomac)\
**Post date:** [October 3, 2018, 11:55am UTC](https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640/2 "2018-10-03T11:55:51Z")

</div>

Sorry, some of the last message got left off.

Here is what was left out - (I left off the “\<” from the beginning of the tags to see if that is why it got left off.

link href="/resources/css/fonts.css?rwcache=560259835" rel=“stylesheet” type=“text/css” /\>  
link href="/resources/css/jquery.maxlength.css?rwcache=560259835" rel=“stylesheet” type=“text/css” /\>  
script src="…/…/resources/javascript/jquery-1.11.1.min.js?rwcache=560259835"\>  
script type=“text/javascript” src="%resource(javascript/jquery.validate.js?rwcache=560259835"\>  
script type=“text/javascript” src="…/…/resources/javascript/jquery.maskedinput.js?rwcache=560259835"\>

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [October 3, 2018, 12:30pm UTC](https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640/3 "2018-10-03T12:30:30Z")

</div>

It’s hard to tell what’s going on from your posts.

To put code on this forum you can selsct the lines of “code” and select the `</>` right above where you’re typing.

I think it would be clearer if you repost the actual code you are pasting in, alongside where you’re pasting it. And list separately what results you’re seeing, or provide a URL to a test page.

---

<div class="post-metadata">

**Author:** ![sykomac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/sykomac/32/11664_2.png) [@sykomac](https://forums.realmacsoftware.com/u/sykomac)\
**Post date:** [October 3, 2018, 12:50pm UTC](https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640/4 "2018-10-03T12:50:52Z")

</div>

Sure - here is the code and a link.

[LMP Test](https://future.lauramarrprinting.com/quote/cart/)

Although the same code is listed below and you don’t need to look through the page source.

Code I have in the **Code Setting --\> Head Section**

```
	<link href="%resource(css/fonts.css)%" rel="stylesheet" type="text/css" />
<link href="%resource(css/jquery.maxlength.css)%" rel="stylesheet" type="text/css" />

	<script src="%resource(javascript/jquery-1.11.1.min.js"></script>

```

**Looks like this when published:** First 2 lines need to start “…/…/” just like the third line.

```
	<link href="/resources/css/fonts.css" rel="stylesheet" type="text/css" />
<link href="/resources/css/jquery.maxlength.css" rel="stylesheet" type="text/css" />

<script src="../../resources/javascript/jquery-1.11.1.min.js"></script>

```

Code I have placed on the **page in the HTML Section --\> Head area**

```
<link href="%resource(css/zebra/zebra_dialog.css)%" rel="stylesheet" type="text/css" />
<link href="%resource(css/order.css)%" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="%resource(javascript/zebra_dialog.js)%"></script>

```

**Looks like this when published:** First line comes out totally wrong, the next 2 are good.

```
    <link href="%resource(css/zebra/zebra_dialog.css" rel="stylesheet" type="text/css" />
<link href="../../resources/css/order.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../resources/javascript/zebra_dialog.js"></script>

```

Doesn’t seem to be any rhyme or reason as to when or where it places the correct link to resources.

Thank you,  
Paul

---

<div class="post-metadata">

**Author:** ![sykomac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/sykomac/32/11664_2.png) [@sykomac](https://forums.realmacsoftware.com/u/sykomac)\
**Post date:** [October 3, 2018, 3:01pm UTC](https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640/5 "2018-10-03T15:01:22Z")

</div>

@dan not sure if you might be able to shed some light on this for me.

Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [October 3, 2018, 10:13pm UTC](https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640/6 "2018-10-03T22:13:47Z")

</div>

> [@sykomac](#):
>
> ```auto
> <link href="%resource(css/fonts.css)%" rel="stylesheet" type="text/css" />
> <link href="%resource(css/jquery.maxlength.css)%" rel="stylesheet" type="text/css" />
> 
> <script src="%resource(javascript/jquery-1.11.1.min.js"></script>
> 
> ```

I think you have some of this backward.  
The first two lines `fonts/css'`and `maxlength.css` are loading fine on the site(status 200). The pathname is valid starting with a `/` just starts at the root level.

The jquery you are loading is the one that’s bad.

```auto
<script src="%resource(javascript/jquery-1.11.1.min.js"></script>

```

The macro to load from Resources is invalid. It would need a closing `)%`

You also are loading (or trying to load) three versions of the jQuery library 1.11.1(didn’t load), 1.7.1(loaded as jquery.min.js) and jquery-2.2.4.min.js.  
 ![2018-10-03_14-45-57](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/d/d29439d41bddb8f165667cdaaf83aaf6375dd1c4.png)

---

<div class="post-metadata">

**Author:** ![sykomac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/sykomac/32/11664_2.png) [@sykomac](https://forums.realmacsoftware.com/u/sykomac)\
**Post date:** [October 4, 2018, 10:19am UTC](https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640/7 "2018-10-04T10:19:06Z")

</div>

@teefers  
I’m not worried at the moment with the jquery loading.

If you look at the second example in my message, you will see that RW does not replace the Resource reference with the actual URL to the resource.

Also, in the first example using the fonts.css, even though the file itself is 2 folders up in the directory, should’t the reference to it be the same as the others - i.e. start with ‘…/…/’ ?

Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![Aaron](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/aaron/32/12210_2.png) [@Aaron](https://forums.realmacsoftware.com/u/Aaron)\
**Post date:** [October 9, 2018, 5:46pm UTC](https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640/8 "2018-10-09T17:46:52Z")

</div>

Paul,

Looking back at this, I see you’re missing some closing resource macro parentheses.

For jQuery-1.11.1.min.js, you’re missing a closing `)%`

I suspect that’s what’s causing this anomalies. Try fixing and let me know if that fixes those issues!

---

<div class="post-metadata">

**Author:** ![sykomac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/sykomac/32/11664_2.png) [@sykomac](https://forums.realmacsoftware.com/u/sykomac)\
**Post date:** [October 9, 2018, 6:24pm UTC](https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640/9 "2018-10-09T18:24:49Z")

</div>

@Aaron I didn’t see that.

I fixed it; however, it didn’t fix anything. I still get the wrong link info.

I did try something that has fixed it completely – I took anything that referenced a resource out of the Code Section of the settings and placed it in the HTML Code–\>Head area of EACH page.

Not sure if that helps you any.

At least if fixed my code.

Paul

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/system/32/25301_2.png) [@system](https://forums.realmacsoftware.com/u/system)\
**Post date:** [November 9, 2018, 4:24am UTC](https://forums.realmacsoftware.com/t/strange-publishing-issue-with-resources/22640/10 "2018-11-09T04:24:50Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
