Index: /gli/trunk/src/org/greenstone/gatherer/collection/Collection.java
===================================================================
--- /gli/trunk/src/org/greenstone/gatherer/collection/Collection.java	(revision 19040)
+++ /gli/trunk/src/org/greenstone/gatherer/collection/Collection.java	(revision 19041)
@@ -182,4 +182,46 @@
     public String getName() {
 	return file.getParentFile().getName();
+    }
+
+    /** @return just the name of the collection group if any, else returns "" */
+    public String getCollectionGroupName() {
+	String groupAndColName = getGroupWithName(true);
+
+	int slash = groupAndColName.indexOf('/');
+	if(slash == -1) {
+	    return "";
+	} else { // remove the colName from the end, to get the groupName
+	    return groupAndColName.substring(0, slash);
+	}
+    }
+
+    /** 
+     * If the collection is part of a collection group, returns the 
+     * colgroupname/colname, else returns the colname.
+     * If url = true, then returns the sub-path as a URL (containing / only), 
+     * and if url = false, then the sub-path is returned in filepath form 
+     * (\ or /, depending on the OS).
+     * @return collection-group-name/collection-name
+     */
+    public String getGroupWithName(boolean url) {
+	// Subtracting collect dir's path from the current collection's path
+
+	String groupAndCol;
+	String collectDir = Gatherer.getCollectDirectoryPath();
+	String currentCollDir = file.getParentFile().getAbsolutePath(); 
+   
+	if(currentCollDir.startsWith(collectDir)) {
+	    groupAndCol = currentCollDir.substring(collectDir.length());	    
+	} else {
+	    // shouldn't happen, but in case it does, just return the collection name.
+	    System.err.println("Current collection " + currentCollDir + " is not located inside collectdir " + "collectDir");
+	    groupAndCol = getName();
+	}
+
+	if(url) {
+	    groupAndCol = groupAndCol.replace('\\', '/');
+	}
+
+	return groupAndCol;
     }
     
Index: /gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java
===================================================================
--- /gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java	(revision 19040)
+++ /gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java	(revision 19041)
@@ -916,4 +916,18 @@
     }
 
+    /** Returns the "collectionGroupName/collectionName" or just the collectionName 
+     *  depending on whether the collection is part of a collection group or not.
+     * If url = true, then returns the sub-path as a URL (containing / only), 
+     * and if url = false, then the sub-path is returned in filepath form 
+     * (\ or /, depending on the OS).
+     */
+    static public String getLoadedColNameWithGroup(boolean url)
+    {
+	if (collection != null) {
+	    return collection.getGroupWithName(url);
+	}
+
+	return null;
+    }
 
     public CollectionTree getCollectionTree()
Index: /gli/trunk/src/org/greenstone/gatherer/gui/PreviewButton.java
===================================================================
--- /gli/trunk/src/org/greenstone/gatherer/gui/PreviewButton.java	(revision 19040)
+++ /gli/trunk/src/org/greenstone/gatherer/gui/PreviewButton.java	(revision 19041)
@@ -74,8 +74,14 @@
     }
     protected void configureHomeURL() {
+	// we could be working with standalone collections or collection groups
+	// so getting a collection-name may have a collection group prefix
+	// This means CollectionManager.getLoadedCollectionName() is no longer sufficient
+	String collGroupWithName = CollectionManager.getLoadedColNameWithGroup(true); 
+
 	// set up the home page for the current collection
 	if (Gatherer.GS3 && !Configuration.fedora_info.isActive()) { // GLI for GS3 case
 	    // don't do anything fancy here
-	    preview_address = Configuration.library_url.toString() + Configuration.getServletPath() + "?a=p&sa=about&c=" + CollectionManager.getLoadedCollectionName() + "&l=" + Configuration.getLanguage();
+	    preview_address = Configuration.library_url.toString() + Configuration.getServletPath() 
+		+ "?a=p&sa=about&c=" + collGroupWithName + "&l=" + Configuration.getLanguage();
 	    return;
 	}
@@ -86,5 +92,5 @@
 	
 	// FLI or GLI for GS2 case (no library_url)
-	preview_address = Configuration.library_url.toString() + "?c=" + CollectionManager.getLoadedCollectionName() + "&l=" + Configuration.getLanguage();
+	preview_address = Configuration.library_url.toString() + "?c=" + collGroupWithName + "&l=" + Configuration.getLanguage();
 
 	String main_args = "&a=p&p=about";
