Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsWikiWikiWiki NavigationWiki Navigation
Previous
 
Next
New Post
11/16/2007 5:02 AM
 

I have just modified the wiki to allow "back" links by that I mean that by clicking the title the user is able to see and go to all the topics that link to the current topic they are viewing. I would post the code for this here but I'm not yet happy with it as it really is very much hacked together but I'm going to pop up the db info as I'm fairly happy with that though I'm positive the querys could be improved.

-- This creates the table and and index

USE [EWDSDNN] -- Change this to the db that you use...
GO
/****** Object:  Table [dbo].[Wiki_LinkIndex]    Script Date: 11/16/2007 09:39:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Wiki_LinkIndex](
    [LNKID] [int] IDENTITY(1,1) NOT NULL,
    [ParentID] [int] NOT NULL,
    [ChildName] [nvarchar](50) NOT NULL,
    [moduleID] [int] NOT NULL,
 CONSTRAINT [PK_Wiki_LinkIndex] PRIMARY KEY CLUSTERED
(
    [LNKID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX
[NC_Wiki_Link] ON [dbo].[Wiki_LinkIndex]
(
    [ParentID] ASC,
    [ChildName] ASC,
    [moduleID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
-- get topics by child
CREATE PROCEDURE [dbo].[Wiki_TopicLinkIndexGetByName]
  @topicName varchar(50)
  ,@moduleID int
  AS
  SET NOCOUNT ON

  SELECT t.Name
  FROM dbo.Wiki_LinkIndex as l Join dbo.Wiki_Topic as t on
    t.topicID = l.parentID
  WHERE
    l.childName = '[['+ @topicName + ']]'
    AND l.moduleID = @moduleID
  ORDER BY Name
GO
-- Add Child
CREATE PROCEDURE [dbo].[Wiki_TopicLinkIndexAdd]
  @moduleid int
  ,@parentid int
  ,@childName varchar(50)
  AS
  SET NOCOUNT ON

  INSERT INTO dbo.Wiki_LinkIndex([ParentID],[ChildName],[moduleID])
    VALUES(@parentid, @childName,@moduleid)
GO
--- Delete links for a parent
CREATE PROCEDURE [dbo].[Wiki_TopicLinkIndexDelete]
  @parentid int
  AS
  SET NOCOUNT ON

  DELETE FROM dbo.Wiki_LinkIndex
  WHERE ParentID = @parentid
GO
-- End of Script

 

This does imply a parent child relationship between items but in reality is more peer to peer.

I will post up what I have done to the vb to get this working soon.

 

 

EDIT:

 

Okay I have a working demo available now on http://ewds.strath.ac.uk/Development.aspx


John Nicholson
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsWikiWikiWiki NavigationWiki Navigation


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out