MSM path plugin
Posted: 26 August 2008 07:41 PM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  51
Joined  03-16-2008

Hi all…I have purchased the MSM module, have it installed and working okay across my three sites (they pull in the templates, etc correctly).

I am however having trouble with the “weblog:entries” tag, and the {path=} variable.

Here is what is happening…

I am on viewing templates from SiteA at http://siteA.mydomain.com/ - this works fine, and pulls in weblog entries from the SiteA weblogs no worries.

When I put this code into a SiteA template:

{exp:weblog:entries weblog="static" site="SiteB"}
- {title}<br />
-
{path=test/something}
{
/exp:weblog:entries}

What I get back is:

- SiteB Test Title
- http://siteA.mydomain.com/test/something/

I have set the CP >  Admin > System Preferences > General Configuration URL’s correctly, but when using the “site=” parameter, it does NOT set the “path=” variable correctly.

Any ideas?

Thanks in advance.

Mod Edit: Moved to the Technical Support forum.

 Signature 
Profile
 
 
Posted: 27 August 2008 02:58 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15488
Joined  05-15-2004

I am afraid that is expected behavior, the {path} variable always takes the current site into account. I think a feature request to support specifying the site (much as we have with {embed}) would be an excellent idea. Until then, perhaps you could use some other variables of the weblog module? {comment_url_title_auto_path} or {permalink} might be a good choice.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 27 August 2008 03:32 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  51
Joined  03-16-2008

Thanks Ingmar.  I figured that that might be the answer… it’s a shame, as I really like the path variable!  Oh well, not to worry!

Do you know if there is any way to get another sites URL with any variable (outside the weblog:entries tag)...something like…

{site_url site="SiteB"}

Thanks for your help…it is much appreciated.

 Signature 
Profile
 
 
Posted: 27 August 2008 05:32 AM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12433
Joined  04-29-2002

agun, you could of course create a global variable for that site or use Fresh Variables to have the variable work on all your MSM sites.

Does that make sense?

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 27 August 2008 05:37 AM   [ Ignore ]   [ # 4 ]  
Grad Student
Avatar
Rank
Total Posts:  51
Joined  03-16-2008

Thanks Sue.  You are right of course very right about the variables (although I am not sure what Fresh Variables are…will have to look that up!!).  My only concern (and it is because I am a finicky bugger) is that I then have to update the URLs in even more places!

What I am doing at the moment is building a little plugin to do this for me. You would call it by doing something like:

{exp:site_url site="SiteB"}

I will post it once I have it working.

grin

 Signature 
Profile
 
 
Posted: 27 August 2008 05:58 AM   [ Ignore ]   [ # 5 ]  
Grad Student
Avatar
Rank
Total Posts:  51
Joined  03-16-2008

As promised, here is a REALLY basic plugin that you can use to grab the site_url from any of the sites listed in the exp_sites table.

Just bung the file into the system/plugin directory and you are away.

The tag MUST have the ‘site’ parameter.  It can have either the site’s short_name, or the site_id.  Some examples:

{exp:site_url site="default_site"}

OR

{exp:site_url site="1"}

It will return…well the site_url for that site!  If it can’t find the site, then it return blank.

File Attachments
pi.site_url.zip  (File Size: 2KB - Downloads: 21)
 Signature 
Profile
 
 
Posted: 27 August 2008 06:24 AM   [ Ignore ]   [ # 6 ]  
Grad Student
Avatar
Rank
Total Posts:  51
Joined  03-16-2008

Sorry to keep bugging you…but I have extended the plugin.  I have also renamed it badly (so hopefully it doesn’t conflict with anything else!!).

To get the site_url of a particular site…

{exp:sites:site_url site="default_site"}

OR

{exp:sites:site_url site="1"}

To add in a path to the site_url of a particular site…

{exp:sites:path site="default_site" path="template_group/template"}

OR

{exp:sites:path site="1" path="template_group/template"}

Any suggestions for improvement are welcomed.

File Attachments
pi.sites.zip  (File Size: 2KB - Downloads: 21)
 Signature 
Profile
 
 
Posted: 27 August 2008 07:13 AM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23547
Joined  05-20-2002

Nifty idea.  Since it got into a custom plugin, I’m going to shift to the ‘plugin’ forum where folks are more likely to look for it.  I’ll tweak the title a bit as well.

Thanks for sharing it with the community!

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 27 August 2008 02:24 PM   [ Ignore ]   [ # 8 ]  
Grad Student
Avatar
Rank
Total Posts:  51
Joined  03-16-2008

Thanks Robin for moving this to a more appropriate forum.  I am always glad to pitch in and help when I can!  The super active community is one of the top 3 things that sold me on EE.

Cheers.

 Signature 
Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65085 Total Logged-in Users: 36
Total Topics: 82223 Total Anonymous Users: 21
Total Replies: 441915 Total Guests: 222
Total Posts: 524138    
Members ( View Memberlist )
Newest Members:  BombermanhaimtuagocsadamVeNeaDoRHildegaardhrtrulzUNFORGIVEN IIIEmmanuelYanYanTomsB